scaffold v0.1: postgres+pgvector inside-container, schema, markdown ingest, CLI
Skald is a generic story-writer. The database is the product; the binary is the tooling. Everything story-specific lives in rows, not in code. cwho's monorepo + binary-per-role pattern transplanted to this domain. What this commit ships: - Cargo workspace (resolver=3, edition 2024): skald-core (lib) + skald (bin) - Migration 0001: stories, characters, canon_facts, chapters, chapter_summaries, passages (vector(1536)), generation_runs, audit_findings, tags. pgvector + pg_trgm extensions. ivfflat index deferred until we have data (post-import the first ~1k passages and add the index). - skald-core::ingest — markdown parser for the cwho/coast-down shape: '# Title' → '## Chapter N — date' headings → '# Continuity Bible' section with character roster (real + fictional sub-sections) + setting / mystery / historical / liberty / hook sub-sections. Decomposed into structured rows; original bullet body preserved in key_facts/body fields for fidelity. 6 unit tests cover the shape. - skald-core::db — Postgres connection pool + migration runner. - skald-core::models — row types via sqlx::FromRow. - skald binary — clap CLI: 'serve' (http + migrations) and 'import-markdown' (one-shot ingest). - Dockerfile — multi-stage: rust:1.95-bookworm builder, pgvector/ pgvector:pg17 runtime, tini under PID 1, custom entrypoint.sh that boots embedded postgres then execs skald serve. - compose.yml — singleton container, postgres data in volume, story corpus mounted read-only at /seed. Decisions locked 2026-05-13: 1. DB in same container 'till we have a real working tool' (Sulkta) 2. postgres+pgvector (NOT sqlite) — keeps semantic-search story 3. Network-not-socket connection (postgresql://localhost:5432) from day one so future split is config-only, not code-rewrite Not yet wired: - Web UI - clawdforge calls (gen → cleanup → canon-audit pipeline) - Embedding pass - TTS sidecar
This commit is contained in:
commit
390b170c9c
17 changed files with 4065 additions and 0 deletions
37
compose.yml
Normal file
37
compose.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Standalone compose stack for skald v0.1. Postgres lives in the
|
||||
# same container — single deployable unit "till we have a real
|
||||
# working tool" (Sulkta's call, 2026-05-13).
|
||||
#
|
||||
# To deploy on the host:
|
||||
# sudo mkdir -p /srv/appdata/skald/{pgdata,seed}
|
||||
# sudo cp <story>.md /srv/appdata/skald/seed/
|
||||
# sudo cp skald.env /srv/appdata/secrets/skald.env # POSTGRES_PASSWORD=...
|
||||
# docker compose -p skald up -d
|
||||
#
|
||||
# To import the first story:
|
||||
# docker exec skald skald import-markdown \
|
||||
# --path /seed/<story>.md \
|
||||
# --title "<title>"
|
||||
|
||||
services:
|
||||
skald:
|
||||
image: registry.example.local:5000/skald:latest
|
||||
container_name: skald
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "7780:7780"
|
||||
env_file:
|
||||
- /srv/appdata/secrets/skald.env
|
||||
volumes:
|
||||
# Postgres data — persist across container recreates.
|
||||
- /srv/appdata/skald/pgdata:/var/lib/postgresql/data
|
||||
# Markdown corpus to import via `docker exec skald skald import-markdown`.
|
||||
- /srv/appdata/skald/seed:/seed:ro
|
||||
environment:
|
||||
RUST_LOG: ${RUST_LOG:-info}
|
||||
SKALD_LOG_FORMAT: json
|
||||
labels:
|
||||
org.sulkta.domain: "sulkta"
|
||||
org.sulkta.owner: "Sulkta"
|
||||
org.sulkta.managed-by: "compose"
|
||||
org.sulkta.role: "skald"
|
||||
Loading…
Add table
Add a link
Reference in a new issue