feat: community module — PostgreSQL pool, migration runner, CommunityPost, SharedStore (MIT) #47

Closed
opened 2026-04-12 17:14:07 -07:00 by pyr0ball · 0 comments
Owner

Goal

Add a community module to circuitforge-core providing the shared PostgreSQL connection pool, migration runner, and base data models consumed by Kiwi, Snipe, and Peregrine for community/shared-data features.

Architecture

  • CommunityDB — wraps a psycopg2 connection pool + migration runner keyed to its own migrations/ directory
  • CommunityPost — frozen dataclass covering the full element snapshot schema (plan, recipe_success, recipe_blooper post types; flavor scores; dietary tags; allergen flags)
  • SharedStore — base class with typed read/write methods against the community PostgreSQL instance
  • CommunitySignal is BSL 1.1 and lives in cf-orch — not in this issue

BSL Boundary

All code in this issue is MIT. CommunitySignal is out of scope here — see cf-orch tracking issue.

Files

Action Path
Create circuitforge_core/community/__init__.py
Create circuitforge_core/community/db.py
Create circuitforge_core/community/models.py
Create circuitforge_core/community/store.py
Create circuitforge_core/community/migrations/001_community_posts.sql
Create circuitforge_core/community/migrations/002_community_post_reactions.sql
Create tests/community/test_db.py
Create tests/community/test_models.py
Create tests/community/test_store.py
Modify circuitforge_core/__init__.py
Modify pyproject.toml — add psycopg2>=2.9

Tech Stack

Python 3.11+, psycopg2 (not psycopg2-binary), frozen dataclasses, pytest

Consumers

Kiwi (meal plans), Snipe (shared listings/signals), Peregrine (community job insights)

Implementation Plan

circuitforge-plans/circuitforge-core/superpowers/plans/2026-04-12-community-module.md

## Goal Add a `community` module to circuitforge-core providing the shared PostgreSQL connection pool, migration runner, and base data models consumed by Kiwi, Snipe, and Peregrine for community/shared-data features. ## Architecture - `CommunityDB` — wraps a `psycopg2` connection pool + migration runner keyed to its own `migrations/` directory - `CommunityPost` — frozen dataclass covering the full element snapshot schema (plan, recipe_success, recipe_blooper post types; flavor scores; dietary tags; allergen flags) - `SharedStore` — base class with typed read/write methods against the community PostgreSQL instance - `CommunitySignal` is **BSL 1.1 and lives in cf-orch** — not in this issue ## BSL Boundary All code in this issue is **MIT**. `CommunitySignal` is out of scope here — see cf-orch tracking issue. ## Files | Action | Path | |--------|------| | Create | `circuitforge_core/community/__init__.py` | | Create | `circuitforge_core/community/db.py` | | Create | `circuitforge_core/community/models.py` | | Create | `circuitforge_core/community/store.py` | | Create | `circuitforge_core/community/migrations/001_community_posts.sql` | | Create | `circuitforge_core/community/migrations/002_community_post_reactions.sql` | | Create | `tests/community/test_db.py` | | Create | `tests/community/test_models.py` | | Create | `tests/community/test_store.py` | | Modify | `circuitforge_core/__init__.py` | | Modify | `pyproject.toml` — add `psycopg2>=2.9` | ## Tech Stack Python 3.11+, `psycopg2` (not psycopg2-binary), frozen dataclasses, pytest ## Consumers Kiwi (meal plans), Snipe (shared listings/signals), Peregrine (community job insights) ## Implementation Plan `circuitforge-plans/circuitforge-core/superpowers/plans/2026-04-12-community-module.md`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/circuitforge-core#47
No description provided.