Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneeskeeb

Relationships

#853 Epic #847 · Unit 1: Land the ClickHouse projection foundation (schema + init SQL + compose service)

Opened by keeb · 6/27/2026· Shipped 6/27/2026

Part of epic #847 (monotonic-ledger scoring rework + ClickHouse-first projections). This is Unit 1 of 6 and the prerequisite for the rest of the epic — no projection or grant-streaming unit can land until the ClickHouse serving layer exists in-tree.

Problem

services/telemetry/lib/consumers/clickhouse.ts already streams the raw event firehose into a flat swamp.events table in near-real-time (~2s poll, per-watcher-batch insert), but:

  • The init schema its own comment references (infrastructure/clickhouse/init/01-schema.sql) does not exist in the repo.
  • There are ZERO materialized views or aggregating engines.
  • There is NO read path back into the app.
  • The CH engine/schema work currently lives on an unmerged branch.

Scope

  1. Land/merge the unmerged ClickHouse foundation branch. First task: read the branch and document exactly what it contains before merging.
  2. Add infrastructure/clickhouse/init/01-schema.sql defining swamp.events (and the MATERIALIZED dimension columns the consumer comment references).
  3. Add a ClickHouse service to docker-compose.yml so the local stack boots CH alongside Mongo / LocalStack / telemetry.
  4. Confirm ClickHouseConsumer registration (services/telemetry/main.ts, gated on CLICKHOUSE_URL) works end-to-end against the composed service.

Out of scope

  • The score_grants table and any score materialized views (Units 4–5).
  • Any app read path (Unit 5).

Acceptance

  • ClickHouse boots in docker compose up -d.
  • An event POSTed to /ingest lands as a row in swamp.events (smoke test).
  • infrastructure/clickhouse/init/01-schema.sql exists and is applied on CH init.
  • No change to the Mongo scoring path.
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

6/27/2026, 5:37:26 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
keeb assigned keeb6/27/2026, 3:35:37 AM

Sign in to post a ripple.