Skip to content

Latest commit

 

History

History
75 lines (57 loc) · 3.55 KB

File metadata and controls

75 lines (57 loc) · 3.55 KB

ctx by GottZ — Claude Code Instructions

Go-Monolith (ctx CLI + ctxd Daemon), PostgreSQL 18 + pgvector, Custom Context Store, Ollama. MPL-2.0 Lizenz.

Zuerst .project/prompt.md lesen — Arbeitsweise, Architektur, Session-Übergabe. .project/ ist ein privates Submodule (GottZ/ctx-project).

Multi-Tenant-Linie (Branch feat/multi-tenant): Modell C (3 Ebenen Tenant/Scope/Block; scope = Daten-Diskriminator VARCHAR(50), KEIN tenant_id auf Daten-Tabellen). Feature-complete (alle 6 Phasen / 7 Achsen, Migrationen 058–068; optional 066 = tenant-OAuth deferred). Gesamt-Integration-Suite + race grün, Pre-Release-Sicherheits-Audit ohne cross-tenant-Leak. Bau-Wahrheit = git log root..feat/multi-tenant + Commit-Bodies; kanonischer Bau-Stand + Sicherheits-Audit + Roadmap in ctx (ctx query "ctx multi-tenant Bau-Stand"), Plan in .project/plan-multitenant-2026-06-14/, Decision-Board gottz.de/decision.html. Nächster Schritt = Release-Schnitt (RC-1/2/3) + Deploy, kein Wellen-Bau mehr.

Workspace

/compose/n8n/
├── CLAUDE.md                    ← Dieses Dokument
├── .project/                    ← Privates Submodule (prompt.md, todos.md, bench-session-*, Research)
├── go/                          ← Go-Monolith (cmd/, internal/, migrations/)
├── .hooks/                      ← Git Hooks (pre-commit, commit-msg, pre-push)
├── docker-compose.yml           ← Container-Orchestrierung
├── state.sh / test.sh / eval.sh ← Verifikation
└── .env                         ← Credentials (nicht im Repo)

Experimentelle Daten (Bench, Prompts, LLM-Responses, private Block-Content) NICHT unter /tmp ablegen — welt-lesbar und jederzeit anderen Prozessen exposed. Bevorzugter Ort: .project/bench-session-<N>/ (submodule, root-only permissions).

Build & Run

docker compose build ctx            # Go-Binary bauen (multi-stage)
docker compose up -d ctx            # ctx + PostgreSQL starten
docker compose logs -f ctx          # Logs

Containers

Container Image Purpose
ctx n8n-ctx (local build from go/) Go-Server: API, Guard, Dream, Digest, MCP
n8n-db-1 pgvector-timescaledb:pg18 PostgreSQL 18 + pgvector + TimescaleDB

Database Access

docker exec n8n-db-1 psql -U n8n -d n8n                    # n8n DB
docker exec n8n-db-1 psql -U admin -d n8n                   # superuser
docker exec -e PGPASSWORD="$CONTEXT_DB_PASSWORD" n8n-db-1 psql -U "$CONTEXT_DB_USER" -d "$CONTEXT_DB"

Verifikation

bash state.sh                       # Live-Systemzustand
bash test.sh --with-ollama          # 18 System + Retrieval + MCP Tests
bash eval.sh                        # 47 Eval Tests (Baseline-Regression)
bash eval.sh --update-baseline      # Neue Baseline setzen
cd go && go test ./... -short       # Go Unit-Tests

Git Hooks (Pflicht-Setup)

git config core.hooksPath .hooks
  • pre-commit: golangci-lint auf gestagte Go-Dateien
  • commit-msg: README-Review bei feat: Commits und Schema-Migrationen
  • pre-push: erzwingt annotated Tags bei Version-Releases