chain-studio/assets/docs/audit_de.md
flemming-it 3b07d340d5 feat(studio): Welcome page Phase B — embedded doc reader (v0.38.0)
Second slice of the Welcome surface. Operator-facing
documentation now lives inside Studio as bundled assets and
renders inline via a modal sheet — no browser, no external
link, air-gap-tauglich.

- Four operator-readable explainers under `assets/docs/`,
  each with an EN + DE pair:
    architecture[_de].md  — Hub / Module / Flow + how they fit
    security[_de].md       — sandbox model, declared perms,
                              operator ceiling
    audit[_de].md          — hash-chained log, WORM-1 mechanics,
                              `fai admin verify-events`
    flows[_de].md          — flow YAML, templating reference,
                              extract→summarize example
  These are short (≈ 300-500 words each), operator-shaped
  prose. Not copies of the architecture docs in
  fai_platform/docs/architecture/ — those are
  contributor-dense.

- pubspec.yaml declares `assets/docs/` so the markdown ships
  inside the Studio binary. Air-gap deployments read them
  with no network access.

- New `_DocReaderSheet` modal: 85 %-of-viewport bottom sheet,
  drag handle + title bar with the doc icon and close button,
  scrollable Markdown body styled to match Studio chrome.
  Loads `assets/docs/<slug>_<locale>.md` first, falls back to
  the EN file. Locale comes from
  `Localizations.localeOf(context)`.

- `_DocsRow` on the Welcome page sits below the trust-posture
  deck. Two-column grid on ≥ 640 dp, single column below.
  Each card is icon + title + one-line blurb + chevron;
  click opens the reader sheet for that slug.

- 12 new ARB keys for the docs section (header, blurb, four
  card titles + blurbs, close button, error message).
- 4 new icons reused: `account_tree_outlined` (architecture),
  `shield_outlined` (security), `verified_outlined` (audit),
  `alt_route_outlined` (flows).

Implements Phase B of `docs/landing-page-design.md`. Phase C
(live getting-started checklist with persistent state) is the
last remaining slice.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-09 00:24:31 +02:00

70 lines
2.4 KiB
Markdown

# Manipulationssicheres Audit-Log
Jede Aktion des Hubs landet in einem append-only Event-Log.
Modul-Installationen, Flow-Läufe, Freigabe-Entscheidungen,
Kanal-Wechsel, Daemon-Neustarts — alle mit derselben Form
aufgezeichnet.
## So sieht ein Event aus
```
timestamp: 2026-05-08T14:32:11Z
event_id: ev_01H...
event_type: flow.completed
flow_name: extract-summarize
flow_execution: fe_01H...
duration_ms: 1240
module_name: text.summarize
module_version: 0.1.0
detail: { engine: "ollama", model_name: "gemma3:4b",
model_digest: "sha256:..." }
prev_event_sha256: 6f4e...8b5f
```
Das `prev_event_sha256`-Feld ist der Kern. Jedes neue Event
hasht seinen Inhalt zusammen mit dem Hash des vorherigen.
Wer Event N fälschen will, müsste alle Events ab N+1 neu
schreiben — und der Ketten-Kopf würde nicht mehr zu dem
passen, was der Operator zuletzt verifiziert hat.
## Was „WORM-1" bedeutet
WORM-1 ist unsere erste WORM-Stufe (write-once-read-many):
- **Append-only**: Der Hub löscht keine einzelnen Events. Die
CLI/RPC hat eine einzige Batch-Operation,
`clear_event_log`, die den Kanal komplett leert und einen
`chain.reset`-Marker mit Prüfer + Begründung seedet. Auf
beta-/production-Kanälen verweigert.
- **Manipulationssicher**: Die Kette zeigt jede nachträgliche
Änderung. Verifikation läuft bei jedem Doctor-Page-Load
komplett und über `fai admin verify-events`.
- **Selbst-tragend**: SQLite + Ketten-Hash genügen; keine
externe WORM-Senke nötig.
WORM-2 (Linux append-only Datei-Attribut) und WORM-3 (externe
WORM-Senke) sind Roadmap-Punkte, noch nicht ausgeliefert.
## Was du in dieser App siehst
- **Diagnose → Audit-Log**: Live-Anzeige „Kette intakt" /
„Manipulation erkannt" mit Anzahl verifizierter Events.
„Jetzt prüfen" für explizite Neu-Verifikation.
- **Protokoll-Seite**: Live-Stream der letzten Events mit
Filter-Chips (Flow / Step / Modul). Klick auf eine Zeile
öffnet das vollständige Event-JSON.
- **Diagnose → Daemon-Dateien → Audit-DB**: Zeigt die SQLite-
Datei im Datei-Manager.
## Die Kette per Hand prüfen
Wer außerhalb von Studio verifizieren will:
```bash
fai admin verify-events
# Druckt „Hash-Kette intakt: N Events verifiziert" oder nennt
# das erste Event, dessen Hash nicht passt.
```
Die Kette ist die Single Source of Truth — jede andere Audit-
bezogene UI in Studio liest aus ihr.