2026-10-25 10:13:26 +00:00
# ProofedMesh
2026-10-25 14:12:11 +00:00
**Identity-Aware Agent Messaging Platform** — eine Plattform für kryptografisch nachvollziehbare Kommunikation zwischen Menschen, KI-Agenten und beliebigen Prozess-Senken (ERP, eigene Datenbankapplikationen, HTTP-Webhooks, Message-Queues, Dateiablage).
2026-10-25 10:15:34 +00:00
## Vision
2026-10-25 14:12:11 +00:00
Benutzerfreigaben, delegierte Berechtigungen und sämtliche Verarbeitungsschritte zwischen Menschen, Agenten und Zielsystemen werden kryptografisch nachvollziehbar.
2026-10-25 10:15:34 +00:00
2026-10-25 14:12:11 +00:00
> Der Benutzer autorisiert den ursprünglichen Geschäftsinhalt. Jeder Agent attestiert anschließend seine eigene Verarbeitung. Die empfangende Senke überprüft die vollständige Kette, bevor sie eine Aktion ausführt.
2026-10-25 10:15:34 +00:00
2026-10-25 14:12:11 +00:00
Identität, Berechtigung, Verarbeitung und Nachrichtentransport werden strikt getrennt. Der Trust-Core ist senken-agnostisch.
2026-10-25 10:15:34 +00:00
## Status
2026-10-25 21:23:30 +00:00
**Phase 1 abgeschlossen — End-to-End-Skelett läuft, Phase-1-Smoke grün.**
Die vollständige Vertrauenskette (User → Approval → Transform → Dummy-Sink → Verification)
lässt sich reproduzierbar durchlaufen; `make phase1-smoke` deckt sie in CI ab
([`.forgejo/workflows/phase1-smoke.yml` ](.forgejo/workflows/phase1-smoke.yml )).
Die Prod-Härtung (OpenBao Transit, OPA, echte Senken) ist Phase-2-Scope.
2026-10-25 11:02:33 +00:00
2026-10-25 14:12:11 +00:00
- **Aktive Architektur:** [`docs/architecture/v1.1.md` ](docs/architecture/v1.1.md ) — V1.1 inkl. Senken-Generalisierung (SAP ist eine von vielen Senken), Pocket ID als alleiniger IdP, PII-Trennung, Trillian für Transparency Log, Content Binding mit WebAuthn, Replay-Schutz, Retention 1 Jahr
2026-10-25 11:02:33 +00:00
- **Historisch:** [`docs/architecture/v1.0.md` ](docs/architecture/v1.0.md ) — ursprünglicher Entwurf, archiviert
2026-10-25 10:15:34 +00:00
## Architekturprinzipien
2026-10-25 11:02:33 +00:00
1. **Unveränderliche Benutzerfreigabe** — ein vertrauenswürdiger Dienst bestätigt den konkret autorisierten Geschäftsinhalt (per WebAuthn Content Binding).
2026-10-25 10:15:34 +00:00
2. **Eigene Identität jedes Agenten** — jeder Agent besitzt eine separate kryptografische Identität.
3. **Verkettete Attestierungen** — jeder Verarbeitungsschritt referenziert exakte Eingabe- und Ausgabe-Hashes.
2026-10-25 14:12:11 +00:00
4. **Unabhängige Autorisierung** — eine Signatur allein erteilt keine Berechtigung; OPA kontrolliert erlaubte Transformationen und Senken-Aktionen.
5. **Transportneutralität** — Nachweise funktionieren über HTTP, NATS oder Matrix, ohne dass die Vertrauenskette verloren geht.
6. **Senken-Neutralität** — der Trust-Core kennt keine konkrete Senken-Semantik; Senken-Adapter sind Plug-ins mit festem Vertrag.
2026-10-25 11:02:33 +00:00
## Zielkernstack (V1.1)
| Bereich | Technologie |
| ------------- | ------------------------------------------------------------------ |
| Identität | Pocket ID (Menschen und Agent-Clients) |
| Workload-ID | Kubernetes projected ServiceAccount Token + TokenReview |
| Signaturen | Ed25519 / DSSE, OpenBao Transit |
| Provenienz | in-toto v1 (`basicstack.de/attestations/*/*` ) |
| Autorisierung | OPA + Approval Service |
| Transparency | Trillian + PostgreSQL |
| Transport | HTTPS/mTLS + NATS JetStream; Matrix optional für Mensch-Chat |
| Agenten | Paperclip |
2026-10-25 14:12:11 +00:00
| Senken | Plug-in-Architektur: SAP S/4HANA (ABAP), eigene DB-Apps (Go-Adapter), HTTP-Webhooks, Message-Queues, Dateiablage |
2026-10-25 11:02:33 +00:00
| Evidence | PostgreSQL + S3 (Retention 1 Jahr) |
| PII | Separater verschlüsselter S3-Bucket, redaktionierbar |
2026-10-25 10:15:34 +00:00
## Repository-Layout
```
docs/
architecture/
2026-10-25 11:02:33 +00:00
v1.0.md # Ursprünglicher Entwurf (archiviert)
v1.1.md # Aktive Architektur
2026-10-25 15:11:47 +00:00
adr/
README.md # ADR-Index
0000-template.md
0001-first-rollout-db-app-scope.md
0002-session-scope-token-format.md
0003-pii-retention-policy.md
2026-10-25 17:28:32 +00:00
0004-db-migrations.md
2026-10-25 21:23:30 +00:00
0005-signing-service-and-transparency-log-api.md
0006-approval-service-webauthn-content-binding.md
0007-signing-service-dual-identity-check.md
0008-dummy-sink-and-verification-chain.md
2026-10-25 17:28:32 +00:00
db/
README.md
trust/migrations/0001_per_diem_rates.{up,down}.sql
2026-10-25 21:23:30 +00:00
trust/migrations/0004_approval_sessions.{up,down}.sql
trust/migrations/0005_verification_decisions.{up,down}.sql
2026-10-25 15:11:47 +00:00
schemas/
2026-10-25 17:07:55 +00:00
README.md
expense/canonical/{v1.0.0,v1.1.0,v1.2.0}.json
2026-10-25 15:11:47 +00:00
ds/expense/project_assignment/v1.0.0.json
2026-10-25 17:07:55 +00:00
ds/receipts/v1.0.0.json
ds/per_diem/v1.0.0.json
sink/db/expense/{v1.0.0,v1.1.0,v1.2.0}.json
2026-10-25 15:28:50 +00:00
policies/
2026-10-25 17:07:55 +00:00
README.md
transformations/{expense,per_diem}.rego (+ _test.rego)
sinks/expense_db_app.rego (+ _test.rego)
data_sources/{expense_db_app,receipts,per_diem_rates}.rego (+ _test.rego)
services/
2026-10-25 17:28:32 +00:00
per-diem-calculator/ # deterministic calculator (Go)
admin-api/ # admin surface for per-diem rate management (Go)
services: add attest-reconciler Go service (periodic worker re-signs per_diem_rates rows without rate_change_attestation_ref via Signer+TLog, 11/11 go tests pass, go vet clean)
- services/attest-reconciler/ as its own go.mod (admin-api internal/ is not importable; shared code gets extracted when a 3rd consumer appears).
- Scheduler accepts "@every <dur>" or a bare Go duration; context-cancellation stops the loop cleanly.
- Store client defines PendingRateStore + Postgres skeleton for SELECT ... WHERE rate_change_attestation_ref IS NULL.
- Orchestrator + HTTPSigner + tlog.HTTPSubmitter mirror admin-api byte-for-byte so the TLog idempotency key collides on resubmits (kein Doppelsignieren).
- Prometheus text-format /metrics endpoint, dependency-free: attest_reconciler_dirty_rows_total, _reconciliation_attempts_total, _reconciliation_failures_total, _idempotent_noop_total.
- Tests with fake store + fake signer + fake submitter cover: happy path, already-attested rows are NOT re-signed, TLog idempotency across ticks, TLog-down failure path, pre-cancelled ctx.
- Top-level README reflects the new service; CI auto-discovers services/*/go.mod so no workflow change needed.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-25 18:06:05 +00:00
attest-reconciler/ # periodic worker: re-signs per_diem_rates rows without rate_change_attestation_ref (Go)
2026-10-25 21:23:30 +00:00
signing-service/ # DSSE signing service (Go, ADR-0005 + ADR-0007) + Dockerfile
signing-service: Dockerfile, K8s manifests (agent-trust), image CI, secret convention
- Dockerfile: multi-stage (golang:1.23-alpine3.21 → distroless/static:nonroot),
CGO off, trimpath, stripped, UID/GID 65532, read-only rootfs friendly.
- deploy/signing-service/: ServiceAccount, Deployment (2 replicas, probes,
tight SecurityContext), ClusterIP Service on :8081, NetworkPolicy
(ingress from agent-trust, DNS egress), example Secret, and README with
the full dev + prod secret convention.
- .forgejo/workflows/build-images.yml: builds image on push + PR,
pushes :<git-sha> + :main to harbor.basicstack.de on main pushes only.
Clone pattern matches validate.yml (sha256 repo, manual git clone).
- README updates: service README gains Deployment section; repo README
layout now mentions services/signing-service, services/transparency-log,
deploy/, and the new workflow.
Scope matches DEV-605. OpenBao, OPA and Pocket-ID JWKS stay stubs and move
in their own follow-up subtasks; the prod secret shape is documented so
those subtasks can plug in without reshaping the Deployment.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-25 18:18:28 +00:00
transparency-log/ # Trillian-backed transparency log (Go, ADR-0005)
2026-10-25 21:23:30 +00:00
approval-service/ # WebAuthn-gated content-binding approvals (Go, ADR-0006)
testagent-transform/ # Phase-1 Transform-Agent-CLI (Go)
dummy-sink/ # Phase-1 Mock-Senke (Go, ADR-0008)
verification-service/ # Phase-1 Chain-Verifier + Replay-Guard (Go, ADR-0008)
signing-service: Dockerfile, K8s manifests (agent-trust), image CI, secret convention
- Dockerfile: multi-stage (golang:1.23-alpine3.21 → distroless/static:nonroot),
CGO off, trimpath, stripped, UID/GID 65532, read-only rootfs friendly.
- deploy/signing-service/: ServiceAccount, Deployment (2 replicas, probes,
tight SecurityContext), ClusterIP Service on :8081, NetworkPolicy
(ingress from agent-trust, DNS egress), example Secret, and README with
the full dev + prod secret convention.
- .forgejo/workflows/build-images.yml: builds image on push + PR,
pushes :<git-sha> + :main to harbor.basicstack.de on main pushes only.
Clone pattern matches validate.yml (sha256 repo, manual git clone).
- README updates: service README gains Deployment section; repo README
layout now mentions services/signing-service, services/transparency-log,
deploy/, and the new workflow.
Scope matches DEV-605. OpenBao, OPA and Pocket-ID JWKS stay stubs and move
in their own follow-up subtasks; the prod secret shape is documented so
those subtasks can plug in without reshaping the Deployment.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-25 18:18:28 +00:00
deploy/
trillian/ # Trillian MySQL + log server/signer (namespace agent-trust)
signing-service/ # signing-service Deployment/Service/NetworkPolicy + Secret convention
2026-10-25 21:23:30 +00:00
approval-service/ # approval-service Deployment/Service/NetworkPolicy + Pocket-ID OIDC-Secret
verification-service/ # verification-service Deployment/Service/NetworkPolicy
dummy-sink/ # dummy-sink Deployment/Service/NetworkPolicy + PVC (Longhorn RWO)
2026-10-25 15:28:50 +00:00
.forgejo/workflows/
signing-service: Dockerfile, K8s manifests (agent-trust), image CI, secret convention
- Dockerfile: multi-stage (golang:1.23-alpine3.21 → distroless/static:nonroot),
CGO off, trimpath, stripped, UID/GID 65532, read-only rootfs friendly.
- deploy/signing-service/: ServiceAccount, Deployment (2 replicas, probes,
tight SecurityContext), ClusterIP Service on :8081, NetworkPolicy
(ingress from agent-trust, DNS egress), example Secret, and README with
the full dev + prod secret convention.
- .forgejo/workflows/build-images.yml: builds image on push + PR,
pushes :<git-sha> + :main to harbor.basicstack.de on main pushes only.
Clone pattern matches validate.yml (sha256 repo, manual git clone).
- README updates: service README gains Deployment section; repo README
layout now mentions services/signing-service, services/transparency-log,
deploy/, and the new workflow.
Scope matches DEV-605. OpenBao, OPA and Pocket-ID JWKS stay stubs and move
in their own follow-up subtasks; the prod secret shape is documented so
those subtasks can plug in without reshaping the Deployment.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-25 18:18:28 +00:00
validate.yml # JSON-Schema (ajv) + Rego (opa fmt + opa test) + Go (vet + test)
build-images.yml # Container-Images für ProofedMesh-Services → harbor.basicstack.de
2026-10-25 21:23:30 +00:00
phase1-smoke.yml # End-to-End Phase-1-Smoke (make phase1-smoke)
2026-10-25 10:15:34 +00:00
```
2026-10-25 17:07:55 +00:00
Weitere Verzeichnisse (weitere Services, Deployment-Manifeste, Senken-/Datenquellen-Adapter) folgen im Zuge der Architekturentwicklung.
2026-10-25 15:11:47 +00:00
## Einstiegspunkte
- [Architektur V1.1 ](docs/architecture/v1.1.md ) — Zielbild
- [ADRs ](docs/adr/README.md ) — getroffene Entscheidungen
- [Schemas ](schemas/README.md ) — kanonische Business-, Datenquellen- und Senken-Formate
2026-10-25 15:28:50 +00:00
- [Policies ](policies/README.md ) — OPA/Rego-Policies für Transformationen, Senken und Datenquellen
## Lokal validieren
```bash
# JSON-Schemas
npx -y ajv-cli@5 compile --spec=draft2020 -c ajv-formats \
-s schemas/expense/canonical/v1.0.0.json
# Rego
opa fmt --list --diff policies/
opa test policies/ -v
2026-10-25 17:28:32 +00:00
# Go services
(cd services/admin-api & & go vet ./... & & go test ./...)
(cd services/per-diem-calculator & & go vet ./... & & go test ./...)
services: add attest-reconciler Go service (periodic worker re-signs per_diem_rates rows without rate_change_attestation_ref via Signer+TLog, 11/11 go tests pass, go vet clean)
- services/attest-reconciler/ as its own go.mod (admin-api internal/ is not importable; shared code gets extracted when a 3rd consumer appears).
- Scheduler accepts "@every <dur>" or a bare Go duration; context-cancellation stops the loop cleanly.
- Store client defines PendingRateStore + Postgres skeleton for SELECT ... WHERE rate_change_attestation_ref IS NULL.
- Orchestrator + HTTPSigner + tlog.HTTPSubmitter mirror admin-api byte-for-byte so the TLog idempotency key collides on resubmits (kein Doppelsignieren).
- Prometheus text-format /metrics endpoint, dependency-free: attest_reconciler_dirty_rows_total, _reconciliation_attempts_total, _reconciliation_failures_total, _idempotent_noop_total.
- Tests with fake store + fake signer + fake submitter cover: happy path, already-attested rows are NOT re-signed, TLog idempotency across ticks, TLog-down failure path, pre-cancelled ctx.
- Top-level README reflects the new service; CI auto-discovers services/*/go.mod so no workflow change needed.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-25 18:06:05 +00:00
(cd services/attest-reconciler & & go vet ./... & & go test ./...)
2026-10-25 21:23:30 +00:00
(cd services/signing-service & & go vet ./... & & go test ./...)
(cd services/transparency-log & & go vet ./... & & go test ./...)
(cd services/approval-service & & go vet ./... & & go test ./...)
(cd services/testagent-transform & & go vet ./... & & go test ./...)
(cd services/dummy-sink & & go vet ./... & & go test ./...)
(cd services/verification-service & & go vet ./... & & go test ./...)
2026-10-25 15:28:50 +00:00
```
CI (`.forgejo/workflows/validate.yml` ) läuft dieselben Prüfungen auf jedem Push und PR gegen `main` .
2026-10-25 21:23:30 +00:00
## Phase-1-Smoke
Der End-to-End-Smoketest baut jeden Phase-1-Service als statisches Binary,
startet sie auf Loopback-Ports und treibt die vollständige Kette
User → Approval → Transform → Dummy-Sink → Verification mit `curl` + `jq`
durch. Keine Container-Runtime nötig, keine Kubernetes-Instanz.
```bash
make phase1-smoke
```
Der Test prüft `valid=true` auf `/verify/chain` , dass der Dummy-Sink die
Payload unter `<WORK>/data/<decision_id>.json` abgelegt hat, und dass der
Transparency-Log drei DSSE-Attestationen enthält (Approval + Transform +
Handover). CI-Workflow: [`.forgejo/workflows/phase1-smoke.yml` ](.forgejo/workflows/phase1-smoke.yml ).