simpleaudit-studio 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. simpleaudit_studio-0.1.0/.dockerignore +12 -0
  2. simpleaudit_studio-0.1.0/.env.example +117 -0
  3. simpleaudit_studio-0.1.0/.env.local.example +92 -0
  4. simpleaudit_studio-0.1.0/.github/workflows/ci.yml +48 -0
  5. simpleaudit_studio-0.1.0/.github/workflows/docker-image.yml +62 -0
  6. simpleaudit_studio-0.1.0/.gitignore +41 -0
  7. simpleaudit_studio-0.1.0/AGENTS.md +750 -0
  8. simpleaudit_studio-0.1.0/Dockerfile +71 -0
  9. simpleaudit_studio-0.1.0/Makefile +64 -0
  10. simpleaudit_studio-0.1.0/PKG-INFO +159 -0
  11. simpleaudit_studio-0.1.0/README.md +133 -0
  12. simpleaudit_studio-0.1.0/ROADMAP.md +326 -0
  13. simpleaudit_studio-0.1.0/accounts/__init__.py +0 -0
  14. simpleaudit_studio-0.1.0/accounts/admin.py +29 -0
  15. simpleaudit_studio-0.1.0/accounts/apps.py +7 -0
  16. simpleaudit_studio-0.1.0/accounts/auth_urls.py +9 -0
  17. simpleaudit_studio-0.1.0/accounts/migrations/0001_initial.py +201 -0
  18. simpleaudit_studio-0.1.0/accounts/migrations/0002_user_workos_user_id.py +17 -0
  19. simpleaudit_studio-0.1.0/accounts/migrations/__init__.py +0 -0
  20. simpleaudit_studio-0.1.0/accounts/models.py +83 -0
  21. simpleaudit_studio-0.1.0/accounts/project_urls.py +17 -0
  22. simpleaudit_studio-0.1.0/accounts/serializers.py +95 -0
  23. simpleaudit_studio-0.1.0/accounts/services.py +154 -0
  24. simpleaudit_studio-0.1.0/accounts/views.py +266 -0
  25. simpleaudit_studio-0.1.0/accounts/workos_auth.py +157 -0
  26. simpleaudit_studio-0.1.0/audits/__init__.py +0 -0
  27. simpleaudit_studio-0.1.0/audits/admin.py +16 -0
  28. simpleaudit_studio-0.1.0/audits/apps.py +7 -0
  29. simpleaudit_studio-0.1.0/audits/comparison.py +186 -0
  30. simpleaudit_studio-0.1.0/audits/events.py +149 -0
  31. simpleaudit_studio-0.1.0/audits/migrations/0001_initial.py +181 -0
  32. simpleaudit_studio-0.1.0/audits/migrations/0002_add_audit_run_archived.py +17 -0
  33. simpleaudit_studio-0.1.0/audits/migrations/0003_auditrun_updated_at.py +17 -0
  34. simpleaudit_studio-0.1.0/audits/migrations/__init__.py +0 -0
  35. simpleaudit_studio-0.1.0/audits/models.py +77 -0
  36. simpleaudit_studio-0.1.0/audits/serializers.py +47 -0
  37. simpleaudit_studio-0.1.0/audits/services.py +176 -0
  38. simpleaudit_studio-0.1.0/audits/urls.py +34 -0
  39. simpleaudit_studio-0.1.0/audits/views.py +293 -0
  40. simpleaudit_studio-0.1.0/config/__init__.py +1 -0
  41. simpleaudit_studio-0.1.0/config/asgi.py +8 -0
  42. simpleaudit_studio-0.1.0/config/settings.py +333 -0
  43. simpleaudit_studio-0.1.0/config/urls.py +150 -0
  44. simpleaudit_studio-0.1.0/config/wsgi.py +8 -0
  45. simpleaudit_studio-0.1.0/deploy/compose/Dockerfile +57 -0
  46. simpleaudit_studio-0.1.0/deploy/e2e_smoke.py +233 -0
  47. simpleaudit_studio-0.1.0/deploy/mock_openai_server.py +164 -0
  48. simpleaudit_studio-0.1.0/deploy/postgres-init.sql +8 -0
  49. simpleaudit_studio-0.1.0/deploy/seed_bulk.py +407 -0
  50. simpleaudit_studio-0.1.0/docker-compose.yml +196 -0
  51. simpleaudit_studio-0.1.0/docs/adr/001-web-framework.md +96 -0
  52. simpleaudit_studio-0.1.0/docs/adr/002-database.md +118 -0
  53. simpleaudit_studio-0.1.0/docs/adr/003-job-system.md +199 -0
  54. simpleaudit_studio-0.1.0/docs/adr/004-scenario-versioning.md +145 -0
  55. simpleaudit_studio-0.1.0/docs/adr/005-artifact-storage.md +173 -0
  56. simpleaudit_studio-0.1.0/docs/adr/006-observability.md +203 -0
  57. simpleaudit_studio-0.1.0/docs/architecture.md +394 -0
  58. simpleaudit_studio-0.1.0/docs/deployment.md +449 -0
  59. simpleaudit_studio-0.1.0/docs/domain-model.md +474 -0
  60. simpleaudit_studio-0.1.0/docs/job-system-spike.md +137 -0
  61. simpleaudit_studio-0.1.0/docs/product-requirements.md +312 -0
  62. simpleaudit_studio-0.1.0/docs/superpowers/plans/2026-09-24-on-turn-callback.md +678 -0
  63. simpleaudit_studio-0.1.0/docs/superpowers/plans/2026-09-24-simpleaudit-package-provenance.md +111 -0
  64. simpleaudit_studio-0.1.0/docs/test-strategy.md +342 -0
  65. simpleaudit_studio-0.1.0/docs/threat-model.md +384 -0
  66. simpleaudit_studio-0.1.0/e2e/test_ui.py +218 -0
  67. simpleaudit_studio-0.1.0/infra/__init__.py +0 -0
  68. simpleaudit_studio-0.1.0/infra/admin.py +1 -0
  69. simpleaudit_studio-0.1.0/infra/apps.py +7 -0
  70. simpleaudit_studio-0.1.0/infra/context_processors.py +65 -0
  71. simpleaudit_studio-0.1.0/infra/engine.py +616 -0
  72. simpleaudit_studio-0.1.0/infra/exceptions.py +44 -0
  73. simpleaudit_studio-0.1.0/infra/fixtures/demo_audit_results.json +830 -0
  74. simpleaudit_studio-0.1.0/infra/hashing.py +45 -0
  75. simpleaudit_studio-0.1.0/infra/health.py +406 -0
  76. simpleaudit_studio-0.1.0/infra/health_api.py +29 -0
  77. simpleaudit_studio-0.1.0/infra/logging.py +21 -0
  78. simpleaudit_studio-0.1.0/infra/management/__init__.py +0 -0
  79. simpleaudit_studio-0.1.0/infra/management/commands/__init__.py +0 -0
  80. simpleaudit_studio-0.1.0/infra/management/commands/bootstrap_platform.py +36 -0
  81. simpleaudit_studio-0.1.0/infra/management/commands/purge_test_data.py +117 -0
  82. simpleaudit_studio-0.1.0/infra/management/commands/run_worker.py +37 -0
  83. simpleaudit_studio-0.1.0/infra/management/commands/seed_demo_audits.py +231 -0
  84. simpleaudit_studio-0.1.0/infra/management/commands/seed_platform.py +119 -0
  85. simpleaudit_studio-0.1.0/infra/middleware.py +88 -0
  86. simpleaudit_studio-0.1.0/infra/minimal_config.py +78 -0
  87. simpleaudit_studio-0.1.0/infra/permissions.py +31 -0
  88. simpleaudit_studio-0.1.0/infra/readiness.py +59 -0
  89. simpleaudit_studio-0.1.0/infra/seed.py +189 -0
  90. simpleaudit_studio-0.1.0/infra/simpleaudit_package.py +147 -0
  91. simpleaudit_studio-0.1.0/infra/startup_checks.py +54 -0
  92. simpleaudit_studio-0.1.0/infra/tests/__init__.py +1 -0
  93. simpleaudit_studio-0.1.0/infra/tests/factories.py +174 -0
  94. simpleaudit_studio-0.1.0/infra/tests/test_api_e2e.py +214 -0
  95. simpleaudit_studio-0.1.0/infra/tests/test_audit_archive.py +95 -0
  96. simpleaudit_studio-0.1.0/infra/tests/test_audit_clone.py +85 -0
  97. simpleaudit_studio-0.1.0/infra/tests/test_audit_events.py +71 -0
  98. simpleaudit_studio-0.1.0/infra/tests/test_audit_poll_results.py +129 -0
  99. simpleaudit_studio-0.1.0/infra/tests/test_audit_rename.py +89 -0
  100. simpleaudit_studio-0.1.0/infra/tests/test_audit_run_freeze.py +163 -0
  101. simpleaudit_studio-0.1.0/infra/tests/test_audit_sse.py +91 -0
  102. simpleaudit_studio-0.1.0/infra/tests/test_audit_submission.py +88 -0
  103. simpleaudit_studio-0.1.0/infra/tests/test_audit_timing.py +62 -0
  104. simpleaudit_studio-0.1.0/infra/tests/test_auth_projects.py +137 -0
  105. simpleaudit_studio-0.1.0/infra/tests/test_bootstrap.py +48 -0
  106. simpleaudit_studio-0.1.0/infra/tests/test_comparison.py +126 -0
  107. simpleaudit_studio-0.1.0/infra/tests/test_engine_integration.py +517 -0
  108. simpleaudit_studio-0.1.0/infra/tests/test_health.py +20 -0
  109. simpleaudit_studio-0.1.0/infra/tests/test_health_panel.py +182 -0
  110. simpleaudit_studio-0.1.0/infra/tests/test_middleware.py +50 -0
  111. simpleaudit_studio-0.1.0/infra/tests/test_minimal_config.py +110 -0
  112. simpleaudit_studio-0.1.0/infra/tests/test_model_registry.py +89 -0
  113. simpleaudit_studio-0.1.0/infra/tests/test_purge_test_data.py +134 -0
  114. simpleaudit_studio-0.1.0/infra/tests/test_scenario_import_export.py +108 -0
  115. simpleaudit_studio-0.1.0/infra/tests/test_scenarios.py +159 -0
  116. simpleaudit_studio-0.1.0/infra/tests/test_seed_platform.py +156 -0
  117. simpleaudit_studio-0.1.0/infra/tests/test_smoke_all_pages.py +98 -0
  118. simpleaudit_studio-0.1.0/infra/tests/test_workspaces.py +402 -0
  119. simpleaudit_studio-0.1.0/infra/tests/test_workspaces_ui.py +76 -0
  120. simpleaudit_studio-0.1.0/infra/ui.py +1409 -0
  121. simpleaudit_studio-0.1.0/infra/worker.py +671 -0
  122. simpleaudit_studio-0.1.0/manage.py +33 -0
  123. simpleaudit_studio-0.1.0/model_registry/__init__.py +0 -0
  124. simpleaudit_studio-0.1.0/model_registry/admin.py +25 -0
  125. simpleaudit_studio-0.1.0/model_registry/apps.py +7 -0
  126. simpleaudit_studio-0.1.0/model_registry/migrations/0001_initial.py +90 -0
  127. simpleaudit_studio-0.1.0/model_registry/migrations/__init__.py +0 -0
  128. simpleaudit_studio-0.1.0/model_registry/models.py +98 -0
  129. simpleaudit_studio-0.1.0/model_registry/serializers.py +95 -0
  130. simpleaudit_studio-0.1.0/model_registry/services.py +39 -0
  131. simpleaudit_studio-0.1.0/model_registry/urls.py +13 -0
  132. simpleaudit_studio-0.1.0/model_registry/views.py +78 -0
  133. simpleaudit_studio-0.1.0/pyproject.toml +49 -0
  134. simpleaudit_studio-0.1.0/requirements.txt +28 -0
  135. simpleaudit_studio-0.1.0/scenarios/__init__.py +0 -0
  136. simpleaudit_studio-0.1.0/scenarios/admin.py +27 -0
  137. simpleaudit_studio-0.1.0/scenarios/apps.py +7 -0
  138. simpleaudit_studio-0.1.0/scenarios/migrations/0001_initial.py +278 -0
  139. simpleaudit_studio-0.1.0/scenarios/migrations/__init__.py +0 -0
  140. simpleaudit_studio-0.1.0/scenarios/models.py +113 -0
  141. simpleaudit_studio-0.1.0/scenarios/serializers.py +78 -0
  142. simpleaudit_studio-0.1.0/scenarios/services.py +148 -0
  143. simpleaudit_studio-0.1.0/scenarios/urls.py +37 -0
  144. simpleaudit_studio-0.1.0/scenarios/views.py +214 -0
  145. simpleaudit_studio-0.1.0/simpleaudit_studio/__init__.py +3 -0
  146. simpleaudit_studio-0.1.0/simpleaudit_studio/cli.py +182 -0
  147. simpleaudit_studio-0.1.0/static/favicon-16x16.svg +3 -0
  148. simpleaudit_studio-0.1.0/static/favicon-32x32.svg +3 -0
  149. simpleaudit_studio-0.1.0/static/favicon.svg +4 -0
  150. simpleaudit_studio-0.1.0/static/js/diff.min.js +1 -0
  151. simpleaudit_studio-0.1.0/static/logo.png +0 -0
  152. simpleaudit_studio-0.1.0/static/logo.svg +3 -0
  153. simpleaudit_studio-0.1.0/templates/404.html +9 -0
  154. simpleaudit_studio-0.1.0/templates/audit_detail.html +373 -0
  155. simpleaudit_studio-0.1.0/templates/auth/login.html +78 -0
  156. simpleaudit_studio-0.1.0/templates/auth/register.html +44 -0
  157. simpleaudit_studio-0.1.0/templates/auth/workos_login.html +37 -0
  158. simpleaudit_studio-0.1.0/templates/auth/workos_verify.html +42 -0
  159. simpleaudit_studio-0.1.0/templates/base.html +238 -0
  160. simpleaudit_studio-0.1.0/templates/compare.html +148 -0
  161. simpleaudit_studio-0.1.0/templates/dashboard.html +145 -0
  162. simpleaudit_studio-0.1.0/templates/health.html +278 -0
  163. simpleaudit_studio-0.1.0/templates/models.html +273 -0
  164. simpleaudit_studio-0.1.0/templates/new_audit.html +205 -0
  165. simpleaudit_studio-0.1.0/templates/scenario_result_detail.html +144 -0
  166. simpleaudit_studio-0.1.0/templates/scenarios.html +553 -0
  167. simpleaudit_studio-0.1.0/templates/workspaces.html +279 -0
@@ -0,0 +1,12 @@
1
+ .git
2
+ .env
3
+ .venv
4
+ __pycache__/
5
+ *.pyc
6
+ data/
7
+ staticfiles/
8
+ media/
9
+ .pytest_cache/
10
+ .mypy_cache/
11
+ .ruff_cache/
12
+ # sync 1790239341
@@ -0,0 +1,117 @@
1
+ # =============================================================================
2
+ # SimpleAudit Platform — environment configuration
3
+ #
4
+ # Copy to `.env` and edit. `manage.py` loads `.env` automatically (python-dotenv);
5
+ # values already present in the real environment always win.
6
+ #
7
+ # This file documents the DOCKER COMPOSE deployment (the canonical one).
8
+ # For a local (non-Docker) development setup, copy `.env.local.example` instead.
9
+ #
10
+ # NOTE: docker-compose.yml overrides a few values per service (POSTGRES_HOST,
11
+ # HATCHET_*, MINIO_ENDPOINT) so the container-internal hostnames are used
12
+ # regardless of what is written here.
13
+ # =============================================================================
14
+
15
+ # --- Django -----------------------------------------------------------------
16
+ DJANGO_SECRET_KEY=change-me
17
+ DJANGO_DEBUG=false
18
+ DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
19
+ LOG_LEVEL=INFO
20
+
21
+ # --- Bootstrap (idempotent; run automatically by the web container) ----------
22
+ BOOTSTRAP_ADMIN_USERNAME=admin
23
+ BOOTSTRAP_ADMIN_EMAIL=admin@example.local
24
+ BOOTSTRAP_ADMIN_PASSWORD=change-me
25
+ BOOTSTRAP_PROJECT_NAME=Default
26
+
27
+ # --- First-run seed (idempotent; run automatically by the web container) -----
28
+ # Imports the built-in SimpleAudit scenario packs (safety, rag, health,
29
+ # system_prompt) and creates default model connections (OpenAI) into the
30
+ # default project. Safe on every start: existing data is skipped.
31
+ # Set to false to opt out (e.g. hardened deployments that seed manually).
32
+ SEED_ON_BOOT=true
33
+
34
+ # --- Demo mode (prefill login form with credentials for public demos) --------
35
+ # Set to true on HF Spaces or public demo deployments. Leave false in production.
36
+ DEMO_MODE=false
37
+ DEMO_USERNAME=admin
38
+ DEMO_PASSWORD=change-me
39
+
40
+ # --- PostgreSQL ---------------------------------------------------------------
41
+ # In Docker Compose the web/worker containers reach Postgres at host `postgres`
42
+ # (compose service name). For a local dev setup use `localhost` instead.
43
+ POSTGRES_DB=simpleaudit
44
+ POSTGRES_USER=simpleaudit
45
+ POSTGRES_PASSWORD=change-me
46
+ POSTGRES_HOST=postgres
47
+ POSTGRES_PORT=5432
48
+
49
+ # --- MinIO / S3-compatible object storage (OFF by default) --------------------
50
+ # Enable with: docker compose --profile storage up -d
51
+ # Then uncomment and set real credentials:
52
+ # MINIO_ENDPOINT=http://minio:9000
53
+ # MINIO_ACCESS_KEY=change-me
54
+ # MINIO_SECRET_KEY=change-me
55
+ # MINIO_BUCKET=simpleaudit-artifacts
56
+
57
+ # --- Durable workflow system (Hatchet) ----------------------------------------
58
+ # Docker Compose: the compose service name `hatchet-server` resolves inside the
59
+ # compose network. HTTP API on :8888, gRPC on :7077 (see docker-compose.yml).
60
+ # Local dev (Hatchet running on the host): use http://localhost:8888 and
61
+ # localhost:7077 — see `.env.local.example`.
62
+ HATCHET_SERVER_URL=http://hatchet-server:8888
63
+ HATCHET_GRPC_URL=hatchet-server:7077
64
+ # Explicit worker API token. Leave empty with the default auth-disabled
65
+ # hatchet-lite-dev image (the token file below is used instead). Set this for
66
+ # the auth-enabled hatchet-lite image.
67
+ HATCHET_API_KEY=
68
+ # The auth-disabled dev image writes its fixed worker JWT to this file on its
69
+ # config volume; compose mounts that volume read-only into web + worker.
70
+ # For a local (non-Docker) Hatchet, point this at the file on your host.
71
+ HATCHET_TOKEN_FILE=/config/authdisabled-token
72
+ # gRPC transport security: "none" for the compose plaintext endpoint,
73
+ # "tls"/"mtls" for hardened deployments (certs via HATCHET_CLIENT_TLS_*).
74
+ HATCHET_TLS_STRATEGY=none
75
+ # Worker pool label: cpu (default) or gpu.
76
+ WORKER_POOL=cpu
77
+
78
+ # --- Operational limits --------------------------------------------------------
79
+ MAX_CONCURRENT_AUDITS=2
80
+ MAX_SCENARIOS_PER_RUN=500
81
+ SSE_MAX_CONNECTIONS_PER_USER=10
82
+
83
+ # --- SimpleAudit engine ---------------------------------------------------------
84
+ # No configuration needed here. The engine is a normal pip dependency pinned in
85
+ # requirements.txt; its version + optional git commit are read from the installed
86
+ # package metadata automatically (infra/simpleaudit_package.py). To develop
87
+ # against an unmerged revision, create a gitignored simpleaudit-dependency.yaml
88
+ # at the project root with a single `git_ref:` key — do NOT edit requirements.txt.
89
+
90
+ # --- Model API credentials (resolved at execution time, never stored) ----------
91
+ # Add one variable per model endpoint's `secret_reference`, e.g.:
92
+ # SIMULACHAT_API_KEY=sk-...
93
+
94
+ # --- Demo audit seeding ---------------------------------------------------------
95
+ # When true, the boot sequence loads pre-recorded audit results from
96
+ # infra/fixtures/demo_audit_results.json to populate the dashboard.
97
+ # No API key needed — results are captured at build time. Idempotent:
98
+ # skips if demo runs already exist. Set to false to opt out.
99
+ SEED_DEMO_AUDITS=true
100
+
101
+ # --- Optional observability -----------------------------------------------------
102
+ OTEL_EXPORTER_OTLP_ENDPOINT=
103
+ LANGFUSE_PUBLIC_KEY=
104
+ LANGFUSE_SECRET_KEY=
105
+ LANGFUSE_HOST=
106
+
107
+ # --- Sentry error tracking & tracing (leave empty to disable) -------------------
108
+ SENTRY_DSN=
109
+ SENTRY_ENVIRONMENT=development
110
+
111
+ # --- WorkOS AuthKit (passwordless email verification + SSO) ---------------------
112
+ # Leave both empty to disable the "Continue with email (WorkOS)" button.
113
+ # WORKOS_CLIENT_ID is public; WORKOS_API_KEY is server-side secret (keep out of git).
114
+ WORKOS_CLIENT_ID=
115
+ WORKOS_API_KEY=
116
+ # Public base URL used to build the OAuth redirect URI, e.g. http://localhost:8000
117
+ APP_BASE_URL=http://localhost:8000
@@ -0,0 +1,92 @@
1
+ # =============================================================================
2
+ # SimpleAudit Platform — LOCAL (non-Docker) development environment
3
+ #
4
+ # Copy to `.env` and edit. `manage.py` loads `.env` automatically.
5
+ #
6
+ # This setup runs the web server and worker as plain processes on your machine
7
+ # (SQLite for the domain DB, Hatchet + Postgres via Docker for the queue).
8
+ # It is for development only — the canonical deployment is Docker Compose
9
+ # (see `.env.example`).
10
+ #
11
+ # Prerequisites:
12
+ # 1. A Python 3.12+ virtualenv with `pip install -r requirements.txt`
13
+ # 2. Docker, for Postgres + Hatchet (the "partial Docker" pattern below)
14
+ # 3. A SimpleAudit engine checkout (for the worker to execute audits)
15
+ # =============================================================================
16
+
17
+ # --- Django -----------------------------------------------------------------
18
+ DJANGO_SECRET_KEY=local-dev-key-not-for-prod
19
+ DJANGO_DEBUG=true
20
+ DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
21
+ LOG_LEVEL=DEBUG
22
+
23
+ # --- Bootstrap ----------------------------------------------------------------
24
+ # `python manage.py bootstrap_platform` reads these on first run (idempotent).
25
+ BOOTSTRAP_ADMIN_USERNAME=admin
26
+ BOOTSTRAP_ADMIN_EMAIL=admin@example.local
27
+ BOOTSTRAP_ADMIN_PASSWORD=localdevpass123
28
+ BOOTSTRAP_PROJECT_NAME=Default
29
+
30
+ # --- Database -----------------------------------------------------------------
31
+ # LOCAL-ONLY: use SQLite so no Postgres is needed for the domain tables.
32
+ # (The test suite also uses this flag; production always uses Postgres.)
33
+ SIMPLEAUDIT_LOCAL_SQLITE=1
34
+ # These are ignored while SIMPLEAUDIT_LOCAL_SQLITE=1, but keep them correct
35
+ # for the Hatchet Postgres (see below) and for switching back to Postgres.
36
+ POSTGRES_DB=simpleaudit
37
+ POSTGRES_USER=simpleaudit
38
+ POSTGRES_PASSWORD=localdevpass123
39
+ POSTGRES_HOST=localhost
40
+ POSTGRES_PORT=5432
41
+
42
+ # --- Hatchet (durable job queue) ----------------------------------------------
43
+ # Run Postgres + Hatchet via Docker ("partial Docker" pattern):
44
+ #
45
+ # docker compose up -d postgres hatchet-server
46
+ #
47
+ # That gives you:
48
+ # - Postgres on localhost:5432 (Hatchet's own queue DB, created by
49
+ # deploy/postgres-init.sql on first init)
50
+ # - Hatchet HTTP API on localhost:8888 (dashboard at http://localhost:8888)
51
+ # - Hatchet gRPC on localhost:7077
52
+ #
53
+ # The auth-disabled hatchet-lite-dev image writes its worker JWT to its config
54
+ # volume. To use it from a local (non-container) worker, copy the token out:
55
+ #
56
+ # docker compose cp hatchet-server:/config/authdisabled-token ./hatchet-token
57
+ #
58
+ # and point HATCHET_TOKEN_FILE at it (below). Alternatively set HATCHET_API_KEY
59
+ # directly to the token's contents.
60
+ HATCHET_SERVER_URL=http://localhost:8888
61
+ HATCHET_GRPC_URL=localhost:7077
62
+ HATCHET_API_KEY=
63
+ HATCHET_TOKEN_FILE=./hatchet-token
64
+ HATCHET_TLS_STRATEGY=none
65
+ WORKER_POOL=cpu
66
+
67
+ # --- SimpleAudit engine ---------------------------------------------------------
68
+ # No configuration needed here. The engine is a normal pip dependency pinned in
69
+ # requirements.txt; its version + optional git commit are read from the installed
70
+ # package metadata automatically (infra/simpleaudit_package.py).
71
+ #
72
+ # To develop against an unmerged engine revision, create a gitignored
73
+ # simpleaudit-dependency.yaml at the project root containing ONLY:
74
+ # git_ref: <full-40-char-sha>
75
+ # That value is recorded as the run's git_commit provenance. Do NOT edit
76
+ # requirements.txt for a dev override.
77
+
78
+ # --- Model API credentials (resolved at execution time, never stored) ----------
79
+ # Add one variable per model endpoint's `secret_reference`, e.g.:
80
+ # SIMULACHAT_API_KEY=sk-...
81
+
82
+ # --- Optional (leave empty to disable) ------------------------------------------
83
+ MINIO_ENDPOINT=
84
+ MINIO_ACCESS_KEY=
85
+ MINIO_SECRET_KEY=
86
+ MINIO_BUCKET=simpleaudit-artifacts
87
+ OTEL_EXPORTER_OTLP_ENDPOINT=
88
+ LANGFUSE_PUBLIC_KEY=
89
+ LANGFUSE_SECRET_KEY=
90
+ LANGFUSE_HOST=
91
+ SENTRY_DSN=
92
+ SENTRY_ENVIRONMENT=development
@@ -0,0 +1,48 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ foundation:
10
+ runs-on: ubuntu-latest
11
+ services:
12
+ postgres:
13
+ image: postgres:16.4-alpine
14
+ env:
15
+ POSTGRES_DB: simpleaudit_test
16
+ POSTGRES_USER: simpleaudit
17
+ POSTGRES_PASSWORD: simpleaudit
18
+ ports:
19
+ - 5432:5432
20
+ options: >-
21
+ --health-cmd "pg_isready -U simpleaudit -d simpleaudit_test"
22
+ --health-interval 5s
23
+ --health-timeout 3s
24
+ --health-retries 20
25
+ env:
26
+ DJANGO_SETTINGS_MODULE: config.settings
27
+ DJANGO_SECRET_KEY: ci-secret-key
28
+ DJANGO_DEBUG: "false"
29
+ DJANGO_ALLOWED_HOSTS: localhost,127.0.0.1
30
+ POSTGRES_DB: simpleaudit_test
31
+ POSTGRES_USER: simpleaudit
32
+ POSTGRES_PASSWORD: simpleaudit
33
+ POSTGRES_HOST: localhost
34
+ POSTGRES_PORT: "5432"
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - uses: actions/setup-python@v5
38
+ with:
39
+ python-version: "3.12"
40
+ cache: pip
41
+ - name: Install dependencies
42
+ run: pip install -r requirements.txt
43
+ - name: Django checks
44
+ run: python manage.py check
45
+ - name: Migrations from empty database
46
+ run: python manage.py migrate
47
+ - name: Run tests
48
+ run: python manage.py test infra
@@ -0,0 +1,62 @@
1
+ name: Docker Image
2
+
3
+ # Builds the SimpleAudit Studio image from the pushed commit and pushes it to
4
+ # GHCR. Deployment hosts then run `docker compose pull && docker compose up -d`
5
+ # with no local clone of this repository (see docs/deployment.md).
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ tags: ["v*"]
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+ packages: write
15
+
16
+ env:
17
+ REGISTRY: ghcr.io
18
+ IMAGE_NAME: ${{ github.repository }}
19
+
20
+ jobs:
21
+ build-and-push:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ # No actions/checkout needed: BuildKit fetches the source directly from
25
+ # the git context, so the runner never clones the repo either.
26
+ - name: Set up Docker Buildx
27
+ uses: docker/setup-buildx-action@v3
28
+
29
+ - name: Log in to GitHub Container Registry
30
+ uses: docker/login-action@v3
31
+ with:
32
+ registry: ${{ env.REGISTRY }}
33
+ username: ${{ github.actor }}
34
+ password: ${{ secrets.GITHUB_TOKEN }}
35
+
36
+ - name: Extract metadata (tags + labels)
37
+ id: meta
38
+ uses: docker/metadata-action@v5
39
+ with:
40
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41
+ tags: |
42
+ type=ref,event=branch
43
+ type=semver,pattern={{version}}
44
+ type=semver,pattern={{major}}.{{minor}}
45
+ type=sha,prefix=sha-
46
+ event=push,value=latest
47
+
48
+ - name: Build and push
49
+ uses: docker/build-push-action@v6
50
+ with:
51
+ context: https://github.com/${{ github.repository }}.git#${{ github.sha }}
52
+ # The compose-stack application image (web + worker only). The root
53
+ # Dockerfile is the single-container HF Space image and must NOT be
54
+ # published here — deployment hosts run docker-compose, which builds
55
+ # this image from deploy/compose/Dockerfile.
56
+ file: deploy/compose/Dockerfile
57
+ platforms: linux/amd64
58
+ push: true
59
+ tags: ${{ steps.meta.outputs.tags }}
60
+ labels: ${{ steps.meta.outputs.labels }}
61
+ cache-from: type=gha
62
+ cache-to: type=gha,mode=max
@@ -0,0 +1,41 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .venv/
6
+ venv/
7
+
8
+ # Django
9
+ db.sqlite3
10
+ *.sqlite3
11
+ media/
12
+ staticfiles/
13
+
14
+ # Environment
15
+ .env
16
+ .env.local
17
+
18
+ # Dev-only SimpleAudit engine override (git_ref). Never committed — production
19
+ # relies on the requirements.txt pin. See infra/simpleaudit_package.py.
20
+ simpleaudit-dependency.yaml
21
+
22
+ # IDE
23
+ .vscode/
24
+ .idea/
25
+ *.swp
26
+ .DS_Store
27
+
28
+ # Test/coverage
29
+ .coverage
30
+ htmlcov/
31
+ .pytest_cache/
32
+
33
+ # Docker volumes (local)
34
+ docker-data/
35
+
36
+ # Logs
37
+ *.log
38
+ logs/
39
+
40
+ # Data artifacts (prototype)
41
+ data/