206 lines
7.6 KiB
Markdown
206 lines
7.6 KiB
Markdown
# HANDOFF — Vauco OS
|
|
|
|
**Sist oppdatert:** 2026-06-13 07:50 CEST
|
|
**Skrevet av:** Perplexity (stand-in) via GitHub MCP
|
|
**Sprint:** CG4-credits — credit_pools fullført, frontend + backend levert
|
|
|
|
---
|
|
|
|
## ✅ Gjort denne sesjonen (2026-06-13 — morgen, runde 2)
|
|
|
|
| Commit | Task | Detalj |
|
|
|--------|------|--------|
|
|
| [`bc501c1`](https://github.com/vauco-saas/OSVauco/commit/bc501c13ea9fb9da785885fea57b880cca2b07db) | **OQ-31 LØST** `ml/billing_agent.py` | `get_credits_status()` omskrevet: `credit_pools[]` med tre pools, `effective_days = min(runway_days, expires_days)`, `badge_class` (crit/warn/ok/inactive), `warning` som `bool`, utløpsdato fra env-var ISO-datoer (`GOOGLE_CREDIT_INFRA_EXPIRES` etc.). Tre hjelpefunksjoner: `_parse_expires_days()`, `_effective_days()`, `_badge_class()`. |
|
|
| [`c114f6c`](https://github.com/vauco-saas/OSVauco/commit/c114f6c32800c5de63430775e6d8fc7f23fd07d4) | **Frontend** `static/billing-dashboard.html` | Tre separate pool-bars, Free Trial expiry topbar-banner, NOK-visning gjennomgående, `Promise.allSettled()` for robust fetch. |
|
|
|
|
### Nye env-vars som må settes i Cloud Run
|
|
|
|
```
|
|
# Totalbeløp per pool (NOK)
|
|
GOOGLE_CREDIT_INFRA_NOK=5000
|
|
GOOGLE_CREDIT_VERTEX_NOK=2000
|
|
GOOGLE_CREDIT_DIALOGFLOW_NOK=1500
|
|
|
|
# Utløpsdatoer (ISO YYYY-MM-DD) — hentes fra GCP Console
|
|
GOOGLE_CREDIT_INFRA_EXPIRES=2026-07-10
|
|
GOOGLE_CREDIT_VERTEX_EXPIRES=2026-09-01
|
|
GOOGLE_CREDIT_DIALOGFLOW_EXPIRES=2026-09-01
|
|
|
|
# Valutakurs (default 10.5 om ikke satt)
|
|
USDNOK=10.8
|
|
```
|
|
|
|
---
|
|
|
|
## ✅ Verifisering etter deploy (kjør disse)
|
|
|
|
```bash
|
|
# 1. Sjekk at credit_pools har 3 objekter med riktige felter
|
|
curl http://localhost:8080/billing/credits?days=90 | \
|
|
python3 -m json.tool | grep -E '"label"|"effective_days"|"badge_class"'
|
|
|
|
# 2. Bekreft warning er bool (ikke streng)
|
|
curl -s http://localhost:8080/billing/credits?days=90 | \
|
|
python3 -c "import json,sys; pools=json.load(sys.stdin)['credit_pools']; \
|
|
[print(p['label'], p['warning'], type(p['warning']).__name__) for p in pools]"
|
|
|
|
# 3. Test crit-path med 10 dagers utløp
|
|
GOOGLE_CREDIT_INFRA_EXPIRES=$(date -d "+10 days" +%Y-%m-%d) \
|
|
python3 -c "
|
|
import os, sys; sys.path.insert(0,'.')
|
|
os.environ['GOOGLE_CLOUD_PROJECT']='propane-will-491900-m5'
|
|
os.environ['BILLING_TABLE']='propane-will-491900-m5.billing_export.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX'
|
|
from ml.billing_agent import _parse_expires_days, _effective_days, _badge_class
|
|
exp = _parse_expires_days('GOOGLE_CREDIT_INFRA_EXPIRES')
|
|
print('expires_days:', exp, '| badge:', _badge_class(_effective_days(None, exp)))
|
|
# Forventet: expires_days: 10 | badge: crit
|
|
"
|
|
```
|
|
|
|
---
|
|
|
|
## 🔴 Blokkert — ændret status
|
|
|
|
### Problem 1: `cloud-run-proxy` ikke installert på dev-VM
|
|
|
|
```bash
|
|
gcloud components install cloud-run-proxy
|
|
|
|
gcloud run services proxy osvauco-agent \
|
|
--region=us-central1 \
|
|
--project=propane-will-491900-m5 \
|
|
--port=8080
|
|
|
|
curl -s "http://localhost:8080/billing/credits?days=90" | python3 -m json.tool
|
|
```
|
|
|
|
### Problem 2: IAP `roles/run.invoker` (uendret)
|
|
|
|
```bash
|
|
curl -sv -H "Authorization: Bearer $(gcloud auth print-identity-token)" \
|
|
"https://opax.vauco.no/billing/credits" 2>&1 | head -30
|
|
|
|
# Fix hvis 403:
|
|
gcloud run services add-iam-policy-binding osvauco-agent \
|
|
--region=us-central1 --project=propane-will-491900-m5 \
|
|
--member="user:chris.christiansen@vauco.no" --role="roles/run.invoker"
|
|
```
|
|
|
|
---
|
|
|
|
## 🔴 Gjenstående OQ-er
|
|
|
|
| ID | Beskrivelse | Status |
|
|
|----|-------------|--------|
|
|
| **OQ-29** | `GET /notify/channels` mangler | Lav |
|
|
| **OQ-30** | `opax.html` browser-panel ikke pushet | Høy |
|
|
| **OQ-31** | `credit_pools[]` mangler i `get_credits_status()` | ✅ **LØST** 2026-06-13 |
|
|
|
|
---
|
|
|
|
## ✅ Gjort forrige sesjon (2026-06-13 — morgen, runde 1)
|
|
|
|
| Commit | Task | Detalj |
|
|
|--------|------|--------|
|
|
| [`f58ec09`](https://github.com/vauco-saas/OSVauco/commit/f58ec09d4c076b6e552eb06593e919c385673492) | **CG4-credits** `static/billing-dashboard.html` | Credits-panel lagt til: 4 KPI-kort, animert progress-bar, advarselsbanner, kreditter-per-type liste. |
|
|
|
|
## ✅ Gjort 2026-06-12 — kveld
|
|
|
|
| Commit | Task | Detalj |
|
|
|--------|------|--------|
|
|
| [`a773ec2`](https://github.com/vauco-saas/OSVauco/commit/a773ec26fcedb2540dc5a04acdf71269d704dc63) | **DOCS PROXY** `main.py` | `GET /docs/{path}` — henter MD-filer fra privat repo via `GITHUB_PAT` |
|
|
|
|
## ✅ Gjort 2026-06-12 — formiddag
|
|
|
|
| Commit | Task |
|
|
|--------|------|
|
|
| [`50490b0`](https://github.com/vauco-saas/OSVauco/commit/50490b071d5b80252ea32e8db3226064ac9c80c0) | **CG5-onboard** `static/onboard.html` |
|
|
| [`c3357d3`](https://github.com/vauco-saas/OSVauco/commit/c3357d38aa71f13dd06726800a2c57425d6bd1ac) | **CG5-onboard** `main.py` — `GET /onboard` + `POST /onboard/complete` |
|
|
| [`5270166`](https://github.com/vauco-saas/OSVauco/commit/5270166ce13bdbea9e6009e5d1ce3529001afba6) | **CG6** `static/costguard-dashboard.html` |
|
|
| [`f7e64fc`](https://github.com/vauco-saas/OSVauco/commit/f7e64fcea07ea2b1f0c3c898bf798da49a7e2993) | **CG5c** `POST /notify/sms` — Twilio |
|
|
| [`4a1e23e`](https://github.com/vauco-saas/OSVauco/commit/4a1e23e077f2bcb508854c41c47a4d26f82f0124) | **CG5a+CG5b** `POST /notify/webhook` + `POST /notify/email` |
|
|
|
|
---
|
|
|
|
## 🏗 Systemstatus
|
|
|
|
| Komponent | Status |
|
|
|-----------|--------|
|
|
| Cloud Run `osvauco-agent` | ✅ Live `us-central1` |
|
|
| `opax.vauco.no` | ✅ Live |
|
|
| `main.py` | ✅ Hovudapp — alle ruter her |
|
|
| `GET /billing/credits` | ✅ Rute finnes — ⚠️ IKKE testet i prod |
|
|
| `ml/billing_agent.py` `get_credits_status()` | ✅ credit_pools[] levert |
|
|
| `static/billing-dashboard.html` | ✅ Tre pool-bars + Free Trial banner |
|
|
| `static/costguard-dashboard.html` | ✅ Live — CG6 |
|
|
| `static/opax.html` | ✅ Live — browser-panel MANGLER (OQ-30) |
|
|
| `POST /notify/webhook` | ✅ CG5a |
|
|
| `POST /notify/email` | ✅ CG5b |
|
|
| `POST /notify/sms` | ✅ CG5c (Guard+) |
|
|
| `GET /notify/channels` | 🔴 OQ-29 |
|
|
| `docs/gemma/world.md` | ❌ Mangler — blokkerer ML-3a |
|
|
| `GOOGLE_CREDIT_INFRA_NOK` m.fl. | 🔴 Ikke satt i Cloud Run |
|
|
|
|
---
|
|
|
|
## 📋 Nøkkelinformasjon
|
|
|
|
| Nøkkel | Verdi |
|
|
|--------|-------|
|
|
| GCP Project | `propane-will-491900-m5` |
|
|
| Region (LÅST) | `us-central1` |
|
|
| Cloud Run service | `osvauco-agent` |
|
|
| Direct URL | `https://osvauco-agent-zjbqp3prqq-uc.a.run.app` |
|
|
| Public URL | `https://opax.vauco.no` |
|
|
| Hovudapplikasjon | `main.py` (rot i repo) |
|
|
| MCP-server | `opax-mcp/` |
|
|
| Static filer | `static/` |
|
|
| IAP curl | `gcloud auth print-identity-token` — **ingen `--audiences`** |
|
|
| LB IP | `34.98.77.173` |
|
|
| Repo | `vauco-saas/OSVauco` |
|
|
| Eier | `chris.christiansen@vauco.no` |
|
|
| Jason | `jason.vauger@vauco.no` · `gemini-2.5-flash` |
|
|
| Emma | `emma.vauger@vauco.no` — 🔮 ML-3a |
|
|
|
|
---
|
|
|
|
## Env-vars påkrevd
|
|
|
|
```
|
|
# Kreditter — NOK-beløp og utløpsdatoer
|
|
GOOGLE_CREDIT_INFRA_NOK=5000
|
|
GOOGLE_CREDIT_INFRA_EXPIRES=2026-07-10
|
|
GOOGLE_CREDIT_VERTEX_NOK=2000
|
|
GOOGLE_CREDIT_VERTEX_EXPIRES=2026-09-01
|
|
GOOGLE_CREDIT_DIALOGFLOW_NOK=1500
|
|
GOOGLE_CREDIT_DIALOGFLOW_EXPIRES=2026-09-01
|
|
USDNOK=10.8
|
|
|
|
# Varsling
|
|
TWILIO_ACCOUNT_SID=ACxxxx
|
|
TWILIO_AUTH_TOKEN=xxxx
|
|
TWILIO_FROM_NUMBER=+47xxxxxxxx
|
|
|
|
# Docs proxy
|
|
GITHUB_PAT=ghp_xxxx
|
|
DOCS_BRANCH=main
|
|
```
|
|
|
|
---
|
|
|
|
## ⚠️ Regler (uendret)
|
|
|
|
- **Hovudapp er `main.py`** — ikke `agents/core-logic/app.py`
|
|
- **MCP-server er `opax-mcp/`** — ikke `agents/mcp_server/`
|
|
- **Absolutte stier i Python** — `Path(__file__).parent / "..."`
|
|
- **Ikke migrer fra us-central1**
|
|
- **IAP curl: ingen `--audiences`** — bare `gcloud auth print-identity-token`
|
|
- **Ikke rør IAP/OAuth** uten `DEPLOY GODKJENT`
|
|
- **Ikke opprett repos** uten `REPO APPROVED`
|
|
- **Medioteq = joint venture** — ikke SaaS-kunde
|
|
- **CG7 er ikke definert** — ikke start uten direktiv fra Chris
|
|
|
|
---
|
|
|
|
*Vauco AS · propane-will-491900-m5 · us-central1 · Sesjon avsluttet 2026-06-13 07:50 CEST*
|