skald (engine/tortoise): public release prep — AGPL-3.0, generic config, engine-variant README

This commit is contained in:
Sulkta 2026-06-28 21:38:51 -07:00
parent 7225789290
commit a483dc820e
12 changed files with 788 additions and 196 deletions

110
README.md
View file

@ -1,95 +1,43 @@
# skald
# skald`engine/tortoise` variant
Long-form story-writer with canon-keeping, sequel continuity, and
(future) self-hosted audiobook narration. Database is the source of
truth — the writer is the tooling.
This branch is the **Tortoise-TTS backend** variant of
[skald](https://git.sulkta.com/Sulkta-OSS/skald). It carries
engine-specific tuning for Tortoise that doesn't generalise to the
other backends; everything else tracks `main`.
Named for the Old Norse poets who composed and memorized kings'
sagas across generations.
For the full project — the story-writer, the schema, the narration
pipeline — see `main` and the root `README.md`.
## Status: v0.1 — scaffold
## What's different here
What's wired:
Tortoise-TTS is the highest-quality narrator of the three backends,
at the cost of speed: it is far slower than real-time and is meant
for batched, overnight renders rather than interactive use. The
tuning in `engines/tortoise/server.py` covers:
- Rust workspace (`skald-core` + `skald`)
- Postgres schema for stories, characters, canon facts, chapters,
passages, generation runs, audit findings, tags
- pgvector extension installed for future similarity search
- `skald import-markdown` ingests a story file (chapters + bible)
into the schema
- `skald serve` exposes `/health` and runs migrations on boot
- Single-container deploy: postgres + skald in one image
- **Sentence chunking** — long passages are split so each chunk
conditions cleanly.
- **Device selection** — explicit GPU/CPU placement.
- **Pitch / rate modulation** — post-processing for single-voice
multi-character rendering.
Wired (this commit):
Tortoise has ~25 named built-in voices, so no voice cloning is
required. On an 8GB GPU it wants the card largely to itself — stop
the other engines for the duration of a Tortoise run, or give it a
dedicated GPU.
- clawdforge Rust SDK vendored at `vendor/clawdforge/` (upstream:
`Sulkta-OSS/clawdforge` `clients/rust/`)
- `skald-core::forge` — three-pass orchestration shell (gen / cleanup /
audit). Prompts are TODO stubs; pipeline plumbing is in place.
## Usage
Not yet wired:
- Web UI (the inbox + browse + queue surface)
- Prompt templates for the three passes (heavy prompt-engineering
work — own session)
- `skald-core::context` — assemble the LLM context blob from DB rows
(bible + characters + parent prose summaries + similarity-matched
passages)
- Embeddings backfill + ivfflat index
- TTS sidecar container + post-render audit chain (see
`docs/tts-pipeline.md`)
## v0.1 smoke
The Tortoise sidecar speaks the same `POST /synthesize` + `GET
/healthz` contract as the other engines (see `engines/README.md`).
Point skald's `TORTOISE_URL` at it and route `tortoise_*` voices to
it.
```bash
docker compose -p skald up -d
docker exec skald skald import-markdown \
--path /seed/coast-down.md \
--title "The Coast-Down"
curl http://localhost:7780/health
# → { ok: true, db_ok: true, story_count: 1, ... }
docker compose up -d # skald + postgres
# bring up the Tortoise sidecar from engines/tortoise/
```
## Schema (cheat sheet)
```
stories → meta + status + parent/root for series
characters → real or fictional, story-scoped
canon_facts → setting, mystery, theme, rule, historical_anchor, hook
chapters → full prose body
chapter_summaries → short summaries for cheap context loading
passages → paragraph-level + embedding vector(1536)
generation_runs → every LLM call logged
audit_findings → canon audit output (severity + area)
tags → arbitrary labels
```
## Architecture (v0.1 + the plan)
```
┌─────────────────────────────────┐
│ skald container │
│ ┌───────────┐ ┌────────────┐ │
│ │ postgres │ │ skald-rust │ │
│ │ pgvector │←─│ axum + cli │ │
│ │ localhost │ │ :7780 │ │
│ └───────────┘ └─────┬──────┘ │
└─────────────────────────┼────────┘
│ HTTP (future)
┌──────────┐
│clawdforge│
└─────┬────┘
opus calls
```
v1.0+: extract postgres to its own container on db-net. skald
becomes pure stateless rust, connects via `DATABASE_URL`. Migration
is a connection-string change + a network move; the binary doesn't
care where the DB lives.
## License
MIT.
AGPL-3.0-or-later — see `LICENSE`.