145 lines
6.2 KiB
Markdown
145 lines
6.2 KiB
Markdown
# HANDOFF — Vauco OS
|
|
|
|
**Sist oppdatert:** 2026-06-28 23:44 CEST
|
|
**Skrevet av:** Perplexity (for Chris Christiansen)
|
|
**Status:** Fase C — Emma operativ, MCP 16 tools, IAP token utløpt (ADC 8t)
|
|
|
|
---
|
|
|
|
## ⚠️ KRITISKE REGLER — les alltid først
|
|
|
|
- **Hovedapp:** `main.py` i rot — IKKJE `agents/core-logic/app.py`
|
|
- **Dockerfile:** `agents/core-logic/Dockerfile` — WORKDIR `/app`, CMD uvicorn main:app
|
|
- **Region:** `us-central1` | **Service:** `osvauco-agent` | **Prosjekt:** `propane-will-491900-m5`
|
|
- **ALDRI** `--audiences`-flag med `gcloud auth print-identity-token` — det er for service accounts, ikke user accounts
|
|
- **IAP identity token:** hentes fra GCE metadata server, IKKE fra gcloud CLI
|
|
- **Smoke-test:** peker alltid på `/health`
|
|
- **Primær Git:** `http://34.59.131.162:3000/chris/OSVauco` — GitHub er mirror, IKKJE kilde
|
|
- **Emma rapporterer til:** Chris Christiansen `chris.christiansen@vauco.no` — ingen andre kan gi GO
|
|
- **emma_runner.py finnes IKKE** — riktig fil er `emma/emma_run.py`
|
|
|
|
---
|
|
|
|
## 🎯 NESTE OPPGAVE (prioritert)
|
|
|
|
1. **IAP token utløpt** — kjør `gcloud auth application-default login` på VM for å fornye ADC
|
|
(eller bruk metadata server direkte — se auth-flyt under)
|
|
2. **sol-script bug** — `environment: line 7: : No such file or directory` — fiks PATH i sol.sh
|
|
3. **Cloud Build trigger ID** — finn i Cloud Console og legg inn i `scripts/trigger-cloudbuild.sh`
|
|
4. **Gitea post-receive hook** — se `scripts/gitea-post-receive.sh`
|
|
5. **emma-alias permanent** — legg til i `~/.bashrc`
|
|
|
|
---
|
|
|
|
## ✅ Teststatus 2026-06-28 natt
|
|
|
|
| Test | Beskrivelse | Status | Merknad |
|
|
|------|-------------|--------|---------|
|
|
| Mirror | Gitea → GitHub | ✅ | 7c87a8a synkronisert |
|
|
| Test 1 | MCP health | ✅ | `emma_tools: true`, `emma_tool_count: 12` |
|
|
| Test 2 | opax.vauco.no IAP | ❌ | `Invalid IAP credentials: Unable to parse JWT` — ADC-token trolig utløpt (8t) |
|
|
| Test 3 | Emma oppstart | ✅ | `llama3.2`, 38 mønstre, 11 sesjoner, `avg_efficiency: 1.3` |
|
|
| Test 4 | boot.sh | ✅ | Aliaser settes av `~/.bashrc` ved ny terminal — ikke via `source` i TUI |
|
|
| Test 5 | MCP tools | ✅ | 16 tools total: 4 infra + 12 emma |
|
|
|
|
**MCP tools (Test 5):**
|
|
- Infra: `push_static`, `get_build_status`, `deploy_service`, `get_logs`
|
|
- Emma: `gh_list_issues`, `gh_create_issue`, `gh_comment_issue`, `gh_close_issue`, `gh_push_file`, `firestore_write`, `firestore_read`, `secret_get`, `opax_get_customer`, `opax_update_customer`, `opax_create_ticket`, `opax_list_tickets`
|
|
|
|
---
|
|
|
|
## ✅ Fullført i dag (2026-06-28)
|
|
|
|
| Oppgave | Commit | Status |
|
|
|---------|--------|--------|
|
|
| `emma/emma_seed.py` — LEARNINGS 001-016 + boot-minne | `6726da23` | ✅ |
|
|
| `emma/emma_guardrails.py` — 5-nivå risikoscoring | `6726da23` | ✅ |
|
|
| `emma/emma_opax.py` — OPAX-kobling med identity token | `6726da23` | ✅ |
|
|
| `emma/emma_identity.py` — identitet injisert i alle LLM-prompts | `31a405ad` | ✅ |
|
|
| `emma/emma_gitea.py` — direkte Gitea-tilgang | `31a405ad` | ✅ |
|
|
| `emma/setup.sh` — VM-bootstrap én kommando | `47ade3d5` | ✅ |
|
|
| `.gemini/GEMINI.md` — NO-SEARCH-blokk øverst, deduplisert | `87b2dced` | ✅ |
|
|
| `scripts/mirror-to-github.sh` — Gitea→GitHub mirror | `7c87a8a` | ✅ |
|
|
| `scripts/emma.sh` — peker nå på `emma_run.py` | `f098b84` | ✅ (GitHub-only, sync mangler til Gitea) |
|
|
|
|
---
|
|
|
|
## ✅ Fullført tidligere (2026-06-18) — IAP Auth fix for opax-mcp
|
|
|
|
| Oppgave | Status |
|
|
|---------|--------|
|
|
| Identifisert rotårsak: feil IAP audience i identity token-kall | ✅ |
|
|
| Lagt til `roles/iap.httpsResourceAccessor` for `jason-vauger` SA | ✅ |
|
|
| Oppdatert `opax-mcp/server.py` — ny env var `OPAX_IAP_CLIENT_ID` | ✅ |
|
|
| Revisjon `opax-mcp-00020` aktiv med 100% trafikk | ✅ |
|
|
|
|
---
|
|
|
|
## 🖥 Systemstatus
|
|
|
|
| Komponent | URL / Referanse | Status |
|
|
|-----------|-----------------|--------|
|
|
| osvauco-agent (Cloud Run) | https://osvauco-agent-zjbgp3prqg-uc.a.run.app | ✅ Live |
|
|
| opax-mcp (Cloud Run) | https://opax-mcp-357036551735.us-central1.run.app | ✅ Live (rev 00020) |
|
|
| opax.vauco.no IAP | https://opax.vauco.no | ⚠️ IAP-token utløpt — forny ADC |
|
|
| Jason (Vertex AI Agent) | Agent Engine, us-central1 | ✅ Live |
|
|
| Gitea (self-hosted) | http://34.59.131.162:3000 | ✅ Live (v1.22.6) |
|
|
| Emma på VM | `~/OSVauco/emma/` | ✅ morphic.db, 38 mønstre, 11 sesjoner |
|
|
| MCP server lokal | http://localhost:8080 | ✅ 16 tools |
|
|
| emma-alias | ~/.bashrc | ⏳ legg til permanent |
|
|
| GitHub (mirror) | https://github.com/vauco-saas/OSVauco | ✅ mirror aktiv |
|
|
|
|
---
|
|
|
|
## 🔑 Credentials
|
|
|
|
- **Gitea API-token:** Secret Manager → `gitea-api-token`
|
|
- **MCP-Secret:** Secret Manager → `mcp-server-key`
|
|
- **Prosjekt:** `propane-will-491900-m5`
|
|
- **IAP OAuth Client ID (opax backend):** `357036551735-kq8nt7ld38hfqlcfb3n52ef7tala4meo.apps.googleusercontent.com`
|
|
- **VM compute SA:** `357036551735-compute@developer.gserviceaccount.com`
|
|
|
|
---
|
|
|
|
## 🏗 Arkitektur
|
|
|
|
```
|
|
Bruker
|
|
└─► Jason (Vertex AI Agent Engine, Gemini 2.5 Pro)
|
|
└─► osvauco-agent (Cloud Run)
|
|
└─► opax-mcp (Cloud Run, 16 tools)
|
|
└─► [IAP] opax.vauco.no
|
|
|
|
osvauco-dev-vm
|
|
└─► Gemini CLI (denne agenten)
|
|
└─► Emma (lokal MDP/MCoT-agent)
|
|
├─► Morfisk minne (SQLite, 38 mønstre)
|
|
├─► Guardrails (5-nivå)
|
|
├─► OPAX-klient (identity token)
|
|
└─► Gitea-klient
|
|
```
|
|
|
|
**Auth-flyt VM → opax.vauco.no (IAP):**
|
|
```
|
|
VM (Gemini CLI eller Emma)
|
|
→ curl metadata.google.internal → identity token (audience = IAP_CLIENT_ID)
|
|
→ curl https://opax.vauco.no -H "Authorization: Bearer $TOKEN"
|
|
→ IAP validerer token mot roles/iap.httpsResourceAccessor
|
|
→ HTTP 200 (eller 401 hvis SA mangler rollen)
|
|
|
|
NOTAT: ADC-token via gcloud auth login utløper etter 8 timer.
|
|
Bruk alltid metadata server på GCE VM for identity tokens.
|
|
```
|
|
|
|
---
|
|
|
|
## 📚 Relevante docs
|
|
|
|
| Dok | Innhold |
|
|
|-----|---------|
|
|
| `docs/LEARNINGS.md` | Append-only lærdomslogg — LEARNING-001 til 016 |
|
|
| `docs/AGENT_RULEBOOK.md` | Boot-protokoll, deploy-regler |
|
|
| `.gemini/GEMINI.md` | Instrukser til Gemini CLI på VM |
|
|
| `emma/setup.sh` | VM-bootstrap — klon, venv, install, seed |
|
|
| `docs/DNS-OG-INFRASTRUKTUR.md` | DNS-kart, IAP-routing, forwarding rules |
|