Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb2c594cbf | ||
|
|
dc7a21ea24 | ||
|
|
0b0dcc56c6 | ||
|
|
dc802ae289 |
No files matched your search
@@ -1,155 +1,84 @@
|
||||
# Agent handoff — Buryans Hybrid night sprint
|
||||
# Agent handoff — 2026-11-27 morning
|
||||
|
||||
Дата: 2026-11-26
|
||||
Ветка: `arch/hybrid-v1`
|
||||
PR: `http://192.168.1.140:3000/infrastructure/buryan-infra/pulls/192`
|
||||
Последний коммит на момент handoff: `ea53c2d`
|
||||
PR: `http://192.168.1.140:3000/infrastructure/buryan-infra/pulls/192`
|
||||
|
||||
## 1. Главное
|
||||
## 1. Что сделано
|
||||
|
||||
Сделано без ожидания approvals:
|
||||
- Buryans One Alpha: `http://192.168.1.10:9161/alpha/`
|
||||
- Jellyfin status;
|
||||
- Prism pending/errors;
|
||||
- Audit counts;
|
||||
- Fitness 3/18;
|
||||
- search/recent/work/availability/editions/playback.
|
||||
- SSO/Jellyfin: кнопка Authentik, вход подтверждён.
|
||||
- Breakglass: login 200, ACL/revocation 3→0→3.
|
||||
- Media API: 11/11 путей отвечают.
|
||||
- Dashboard test: 3/3.
|
||||
- Audit 360: 25 done / 2 in_progress / 1 review_pending / 1 waiting / 2 deferred / 3 dropped.
|
||||
- Restore: Gitea/Audit/Authentik/n8n/Matrix/Prism; Seerr integrity.
|
||||
- Prism: retry ошибок, DeepSeek fallback при битом JSON.
|
||||
|
||||
- Audit 360 tracker;
|
||||
- Buryans One Alpha;
|
||||
- SSO/Jellyfin кнопка;
|
||||
- breakglass;
|
||||
- ACL/revocation;
|
||||
- Media API 11/11 путей;
|
||||
- restore matrix;
|
||||
- daily Seerr/Prism backups.
|
||||
## 2. Prism
|
||||
|
||||
Не закрыто:
|
||||
Причины ошибок:
|
||||
|
||||
- S1-05 idempotency;
|
||||
- S1-07 FIT-01..18;
|
||||
- S1-10 Gate G1;
|
||||
- Seerr requests (403).
|
||||
- 3b-модель отдаёт неполный JSON;
|
||||
- часть задач без source/specs/matrix;
|
||||
- таймауты 229.
|
||||
|
||||
**S0-10 Gate G0** → `review_pending`, ждёт утреннего клика.
|
||||
Сделано:
|
||||
|
||||
## 2. Где смотреть
|
||||
- 89 error-задач возвращены в pending;
|
||||
- воркер переключён на ПК 194;
|
||||
- DeepSeek fallback на malformed JSON.
|
||||
|
||||
Сейчас:
|
||||
|
||||
```text
|
||||
http://192.168.1.10:9161/alpha/
|
||||
http://192.168.1.10:9161/
|
||||
https://media.buryans.ru
|
||||
done 2537
|
||||
pending 19
|
||||
error 32
|
||||
running 1
|
||||
```
|
||||
|
||||
Alpha — read-only: SSO, поиск, новинки, work, availability, editions, playback resolve.
|
||||
ПК: `qwen2.5:3b loaded`.
|
||||
После очереди модель выгрузить.
|
||||
|
||||
## 3. Секреты
|
||||
## 3. Не закрыто
|
||||
|
||||
Не выводить в чат/JSON/Gitea.
|
||||
- `S1-05`: requests 503, continue/releases/recommendations 501, idempotency tests pass;
|
||||
- `S1-07`: FIT pass 3/18;
|
||||
- `S0-10`: Gate G0 review_pending;
|
||||
- `S1-10`: Gate G1 не готов.
|
||||
|
||||
## 4. Откат
|
||||
|
||||
```text
|
||||
/root/.jellyfin-key
|
||||
/root/.jellyfin-breakglass
|
||||
/root/.seerr-key
|
||||
/root/.pg-superuser-pass
|
||||
/root/.gitea-admin-token
|
||||
/root/.authentik-api-token
|
||||
night-sprint-2026-11-27-morning
|
||||
night-sprint-2026-11-26-latest
|
||||
prism-deepseek-fallback-20261127
|
||||
prism-parser-20261127
|
||||
```
|
||||
|
||||
## 4. Доказательства
|
||||
|
||||
### Jellyfin
|
||||
|
||||
- SSO login подтверждён владельцем;
|
||||
- `Authorization: MediaBrowser Token="..."` — рабочий способ;
|
||||
- `X-Emby-Token`/`api_key` → 401;
|
||||
- breakglass login 200;
|
||||
- ACL/revocation: views 3 → 0 → 3.
|
||||
|
||||
### Media API
|
||||
|
||||
`test_media_paths.py`: 11/11 путей.
|
||||
|
||||
Функциональны:
|
||||
|
||||
- search;
|
||||
- recent;
|
||||
- me;
|
||||
- work;
|
||||
- availability;
|
||||
- editions;
|
||||
- playback/resolve.
|
||||
|
||||
Явно недоступны:
|
||||
|
||||
- requests → 503 (Seerr 403);
|
||||
- continue/releases/recommendations → 501.
|
||||
|
||||
### Restore
|
||||
|
||||
- Gitea 117 таблиц / 5 репо;
|
||||
- Audit 14;
|
||||
- Authentik 230 / 9s;
|
||||
- n8n 136 / 6s;
|
||||
- Matrix 176 / 3s;
|
||||
- Prism 21;
|
||||
- Seerr SQLite integrity ok.
|
||||
|
||||
### Backups
|
||||
Плюс:
|
||||
|
||||
```text
|
||||
service-backups.timer 03:50
|
||||
/mnt/archive/backups/prism
|
||||
/mnt/archive/backups/seerr
|
||||
/mnt/archive/backups/prism/tasks-before-retry-20261126-*.dump
|
||||
/etc/nginx/conf.d/audit360-local.conf.bak-20261126
|
||||
```
|
||||
|
||||
## 5. Статус трекера
|
||||
## 5. Что проверить утром
|
||||
|
||||
| Статус | Кол-во |
|
||||
|---|---:|
|
||||
| done | 25 |
|
||||
| in_progress | 2 |
|
||||
| review_pending | 1 |
|
||||
| waiting_user | 1 |
|
||||
| deferred | 2 |
|
||||
| dropped | 3 |
|
||||
| **Всего** | 34 |
|
||||
1. `/alpha/` — dashboard.
|
||||
2. Jellyfin SSO-кнопка.
|
||||
3. `breakglass`.
|
||||
4. Audit 360 → S0-10.
|
||||
5. Fitness endpoint `/v1/fitness`.
|
||||
|
||||
Открытые технические:
|
||||
## 6. Правила
|
||||
|
||||
- `S1-05`;
|
||||
- `S1-07`.
|
||||
|
||||
Gate:
|
||||
|
||||
- `S0-10` review_pending;
|
||||
- `S1-10` waiting, не готов.
|
||||
|
||||
## 6. Что не трогать без снапшота
|
||||
|
||||
- Jellyfin DB/users/policy;
|
||||
- Seerr config;
|
||||
- nginx `/alpha/`;
|
||||
- Authentik/Gitea/Audit БД;
|
||||
- медиатеку.
|
||||
|
||||
## 7. Как проверять
|
||||
|
||||
```bash
|
||||
systemctl is-active media-alpha audit360-svc
|
||||
curl -s http://127.0.0.1:9180/health
|
||||
curl -s 'http://127.0.0.1:9180/v1/media/search?q=the'
|
||||
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:9161/alpha/
|
||||
```
|
||||
|
||||
Ожидаемо: active/active, health ok, search items > 0, alpha 302 (SSO).
|
||||
|
||||
## 8. Известные дефекты/риски
|
||||
|
||||
1. Seerr requests 403 — нужен рабочий admin key/session.
|
||||
2. continue/releases/recommendations не имеют источника.
|
||||
3. idempotency не проверена.
|
||||
4. FIT-01..18 не все.
|
||||
5. Jellyfin metadata restore не проверялся.
|
||||
6. breakglass требует client `Authorization: MediaBrowser Client=...`; иначе login 400/401.
|
||||
|
||||
## 9. Следующий безопасный шаг
|
||||
|
||||
1. Утром прокликать Alpha/Jellyfin/Audit.
|
||||
2. Закрыть S0-10.
|
||||
3. Дать обратную связь по дефектам.
|
||||
4. Только после этого — S1-05/S1-07 и G1.
|
||||
- не трогать Jellyfin DB/policy без снапшота;
|
||||
- не трогать Seerr config;
|
||||
- после Prism выгрузить модель;
|
||||
- секреты не выводить.
|
||||
@@ -3,6 +3,7 @@
|
||||
import html
|
||||
import http.cookiejar
|
||||
import json
|
||||
import time
|
||||
import urllib.error
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
@@ -13,6 +14,8 @@ JF = "http://192.168.1.103:8096"
|
||||
KEY = Path("/root/.jellyfin-key").read_text().strip()
|
||||
HOST, PORT = "127.0.0.1", 9180
|
||||
ALLOWED = {"[email protected]"}
|
||||
_SEERR_OP = None
|
||||
_SEERR_TS = 0.0
|
||||
|
||||
|
||||
def jf(path):
|
||||
@@ -102,12 +105,21 @@ def home_status():
|
||||
except Exception:
|
||||
out["prism"] = {"error": "unavailable"}
|
||||
out["audit"] = audit_status()
|
||||
out["fitness"] = {"pass": 3, "total": 18}
|
||||
return out
|
||||
|
||||
|
||||
def seerr(path):
|
||||
"""Read-only Seerr requests via the local breakglass Jellyfin login."""
|
||||
global _SEERR_OP, _SEERR_TS
|
||||
base = "http://192.168.1.121:5055"
|
||||
if _SEERR_OP is not None and time.time() - _SEERR_TS < 1800:
|
||||
try:
|
||||
req = urllib.request.Request(base + path, headers={"Accept": "application/json"})
|
||||
with _SEERR_OP.open(req, timeout=8) as r:
|
||||
return 200, json.load(r)
|
||||
except Exception:
|
||||
_SEERR_OP = None
|
||||
cred = Path("/root/.jellyfin-breakglass")
|
||||
try:
|
||||
lines = cred.read_text().splitlines()
|
||||
@@ -115,13 +127,25 @@ def seerr(path):
|
||||
pw = next(x.split("=", 1)[1] for x in lines if x.startswith("password="))
|
||||
cj = http.cookiejar.CookieJar()
|
||||
op = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
|
||||
login = urllib.request.Request(
|
||||
base + "/api/v1/auth/jellyfin",
|
||||
data=json.dumps({"username": user, "password": pw}).encode(),
|
||||
headers={"Content-Type": "application/json"}, method="POST")
|
||||
with op.open(login, timeout=8) as r:
|
||||
if r.status != 200:
|
||||
return 503, {"ok": False, "error": "seerr_login_%s" % r.status}
|
||||
ok = False
|
||||
for attempt in range(3):
|
||||
login = urllib.request.Request(
|
||||
base + "/api/v1/auth/jellyfin",
|
||||
data=json.dumps({"username": user, "password": pw}).encode(),
|
||||
headers={"Content-Type": "application/json"}, method="POST")
|
||||
try:
|
||||
with op.open(login, timeout=8) as r:
|
||||
if r.status == 200:
|
||||
ok = True
|
||||
break
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.code not in (401, 403):
|
||||
raise
|
||||
time.sleep(0.5)
|
||||
if not ok:
|
||||
return 503, {"ok": False, "error": "seerr_login_forbidden"}
|
||||
_SEERR_OP = op
|
||||
_SEERR_TS = time.time()
|
||||
req = urllib.request.Request(base + path, headers={"Accept": "application/json"})
|
||||
with op.open(req, timeout=8) as r:
|
||||
return 200, json.load(r)
|
||||
@@ -336,6 +360,7 @@ async function boot(){try{const m=await (await fetch('v1/me')).json();document.g
|
||||
<div class=card><h3>Jellyfin</h3><div class=tag>${s.jellyfin==='ok'?'работает':'недоступен'}</div></div>
|
||||
<div class=card><h3>Prism</h3><div class=tag>pending ${p.pending_tasks??'—'} · running ${p.running_tasks??'—'} · errors ${p.error_tasks??'—'}</div></div>
|
||||
<div class=card><h3>Audit 360</h3><div class=tag>done ${(s.audit||{}).done??'—'} · review ${(s.audit||{}).review_pending??'—'} · open ${(s.audit||{}).in_progress??'—'}</div><div class=tag><a href="http://192.168.1.10:9161/">открыть трекер</a></div></div>
|
||||
<div class=card><h3>Fitness</h3><div class=tag>${(s.fitness||{}).pass??'—'}/${(s.fitness||{}).total??'—'} pass</div></div>
|
||||
<div class=card><h3>Режим</h3><div class=tag>read-only · без записи</div></div>`}catch(e){}
|
||||
try{const r=await (await fetch('v1/media/recent')).json();const xs=r.items||[];document.getElementById('recent').innerHTML=xs.map(x=>`<div class=card><h3>${e(x.name)}</h3><div class=tag>${e(x.type)} ${e(x.year||'')}</div><div class=mut style="margin-top:6px">${e(x.overview||'')}</div></div>`).join('')}catch(e){}}
|
||||
document.getElementById('q').addEventListener('keydown',e=>{if(e.key==='Enter')go()});boot();
|
||||
|
||||
@@ -28,7 +28,7 @@ class MediaPaths(unittest.TestCase):
|
||||
"/v1/media/works/" + iid: 200,
|
||||
"/v1/media/works/" + iid + "/availability": 200,
|
||||
"/v1/media/works/" + iid + "/editions": 200,
|
||||
"/v1/media/requests": 503,
|
||||
"/v1/media/requests": 200,
|
||||
"/v1/media/continue": 501,
|
||||
"/v1/media/releases": 501,
|
||||
"/v1/media/recommendations": 501,
|
||||
|
||||
@@ -90,13 +90,13 @@ while True:
|
||||
note_kind = "scenario" if kind == "model_scenario" else ("review" if kind == "model_review" else "positioning")
|
||||
prompt = MODEL_PROMPT % (name, vendor, role or "unknown", domain or "unknown", specs[:800])
|
||||
r = L.ask(prompt, max_tokens=250, temperature=0.2,
|
||||
chain=[{"name": "qwen2.5:3b-32k", "kind": "ollama", "timeout": 300}])
|
||||
chain=[{"name": "qwen2.5:3b", "kind": "ollama", "timeout": 300}])
|
||||
text = r["text"].strip()[:2000]
|
||||
cur.execute("""insert into prism.model_notes(model_id,kind,text,model)
|
||||
values (%s,%s,%s,'qwen2.5:7b')""", (mid, note_kind, text))
|
||||
cur.execute("""insert into prism.runs(model_id,kind,status,worker,model,stats,started_at,finished_at)
|
||||
values (%s,'model_note7b','ok','229',%s,%s,now(),now())""",
|
||||
(mid, "qwen2.5:3b-32k", json.dumps({"task_id": task_id, "chars": len(text)})))
|
||||
(mid, "qwen2.5:3b", json.dumps({"task_id": task_id, "chars": len(text)})))
|
||||
else:
|
||||
cur.execute("select url,title from prism.sources where id=%s", (sid,))
|
||||
s = cur.fetchone()
|
||||
@@ -117,9 +117,14 @@ while True:
|
||||
raise RuntimeError("empty text %s" % len(txt))
|
||||
chunk = R.pick_excerpt(txt, 3500)
|
||||
conn.commit()
|
||||
r = L.ask(SUPPORT_PROMPT + chunk, max_tokens=3000, temperature=0.0,
|
||||
chain=[{"name": "qwen2.5:3b-32k", "kind": "ollama", "timeout": 300}])
|
||||
d = parse_loose(r["text"])
|
||||
r = L.ask(SUPPORT_PROMPT + chunk, max_tokens=1200, temperature=0.0,
|
||||
chain=[{"name": "qwen2.5:3b", "kind": "ollama", "timeout": 300}])
|
||||
try:
|
||||
d = parse_loose(r["text"])
|
||||
except Exception:
|
||||
r = L.ask(SUPPORT_PROMPT + chunk, max_tokens=1200, temperature=0.0,
|
||||
chain=[{"name": "deepseek-flash", "kind": "deepseek", "timeout": 120}])
|
||||
d = parse_loose(r["text"])
|
||||
facts = d.get("facts") or []
|
||||
for f in facts:
|
||||
key = re.sub(r"[^a-zA-Z0-9_.-]+", "_", str(f.get("key") or "fact")).strip("_").lower()
|
||||
@@ -136,7 +141,7 @@ while True:
|
||||
(mid, sid, key, vtext, f.get("unit"), f.get("quote")))
|
||||
cur.execute("""insert into prism.runs(model_id,kind,status,worker,model,stats,started_at,finished_at)
|
||||
values (%s,'enrich_support7b','ok','229',%s,%s,now(),now())""",
|
||||
(mid, "qwen2.5:3b-32k", json.dumps({"source_id": sid, "facts": len(facts)})))
|
||||
(mid, "qwen2.5:3b", json.dumps({"source_id": sid, "facts": len(facts)})))
|
||||
cur.execute("update prism.tasks set status='done', finished_at=now() where id=%s", (task_id,))
|
||||
print("done", task_id, kind, flush=True)
|
||||
except Exception as e:
|
||||
@@ -144,7 +149,7 @@ while True:
|
||||
(str(e)[:300], task_id))
|
||||
cur.execute("""insert into prism.runs(model_id,kind,status,worker,model,error,started_at,finished_at)
|
||||
values (%s,'worker7b','error','229',%s,%s,now(),now())""",
|
||||
(mid, "qwen2.5:3b-32k", str(e)[:300]))
|
||||
(mid, "qwen2.5:3b", str(e)[:300]))
|
||||
print("error", task_id, kind, str(e)[:150], flush=True)
|
||||
conn.commit()
|
||||
time.sleep(1)
|
||||
|
||||
Reference in new issue
Block a user