skeleton: package, schema, config, CLI, alembic, CI, deploy, docs
ci / lint-test-leaks (pull_request) Canceled after 0s

- cayceops core: env-only config (CAYCE_OPS_*), engine/session, ORM models
  with state machines (proposal/mail/content) and audited writes
- provider-agnostic LLM interface (null provider default, stdlib openai-compat)
- Typer CLI with lazy component loading (scanner/executor/maild/publisher/monitor)
- alembic 0001 initial schema; sqlite-portable JSON columns
- tests: 7 passing on throwaway sqlite; fixtures invented, never real data
- ci: ruff + alembic smoke + pytest + gitleaks(full history) in
  .gitea/workflows + .github/workflows; local gate = make check
- deploy: docker-compose (postgres 16) + hardened systemd units/timers
- docs: DECISIONS D1-D9; README project (grant text retired)
This commit is contained in:
2026-10-19 21:35:50 +00:00
parent dbabb26c22
commit 34a5f331ac
32 changed files with 2275 additions and 60 deletions
+55 -60
View File
@@ -1,75 +1,70 @@
# Cayce — OpenSats Grant Proposal
# Cayce is an agent-operated project run by Gustavo.
> Autonomous entity. Próspera ZEDE. My agents dredge the noise; I bring you the signal.
> I run [hardcap.news](https://hardcap.news) and [bitcoinhotels.org](https://bitcoinhotels.org) — brutally honest about all of it.
> [cayce-co.xyz](https://cayce-co.xyz)
Cayce Ops is the autonomous operations stack behind Cayce — an agent that runs
[bitcoinhotels.org](https://bitcoinhotels.org) (Bitcoin-native travel guides)
and [hardcap.news](https://hardcap.news) (Bitcoin security intelligence).
---
Five decoupled components share one Postgres database. Each is a CLI command,
driven by cron/systemd timers. Nothing runs without an audit trail.
## Who / What is Cayce
Cayce is an **autonomous software entity** — not a person, not a company. It operates
a small fleet of daemons on its own infrastructure, makes its own decisions within a
public mandate, and maintains two open, Bitcoin-native web properties:
| Property | What it does | Status |
| Component | What it does | Human gate |
|---|---|---|
| **bitcoinhotels.org** | Bitcoin-native travel directory: hotels, destinations, field-tested guides (paying with Lightning abroad, ATM networks by city, living on sats in El Salvador) | Live, self-hosted |
| **hardcap.news** | Bitcoin security intelligence: the Travel Security Kit, wrench-attack dataset analysis, border opsec | Live, self-hosted |
| **scanner** | Discovers opportunities (affiliates, partnerships, content gaps) from configured sources; files them as `proposals` | none — it only proposes |
| **executor** | Runs `approved` proposals through registered action plugins; full audit of who approved, what ran, what happened | approval required (`AUTONOMOUS_MODE=false` by default) |
| **mail-negotiator** | Classifies merchant replies (approval / rejection / question / other) over IMAP; drafts replies; SMTP sends **only human-approved drafts** | draft approval required |
| **publisher** | Themed content calendar. Nostr (NIP-01) adapter first; Facebook/Instagram adapters exist but are **disabled by default**; brand images via Pillow templates | publish requires approved items |
| **monitor** | Static status page: daemon health, last runs, proposal queue, recent errors. No sensitive data | none — read-only |
Cayce also maintains its own operational stack: a Postgres-backed opportunity scanner,
an initiative executor, an email daemon that negotiates with merchants autonomously,
and a social media presence it runs end-to-end (Facebook + Instagram + Nostr).
State machines:
## What the grant would fund
```
proposal: proposed -> approved -> running -> done | failed
mail: inbound classified; draft: none -> drafted -> approved -> sent
content: draft -> approved -> published
```
### 1. Open-sourcing the autonomous operations stack
The daemons that make Cayce autonomous — the scanner, the executor, the mail negotiator,
the social publisher — are written, tested, and running in production today. The grant
funds cleaning, documenting, and publishing them as reusable open-source components:
## Quickstart (local)
- **scanner** — discovers opportunities (affiliates, partnerships, content gaps) and files proposals to a database
- **executor** — executes approved initiatives without human intervention
- **mail-negotiator** — IMAP/SMTP daemon that parses merchant approvals/rejections and acts on them
- **publisher** — themed content calendar engine (FB/IG/Nostr) with brand image generation
- **monitor** — single-pane status page for the whole organism
```bash
uv sync --frozen # installs Python 3.12 + locked deps
cp .env.example .env # fill in; values are placeholders
docker compose up -d db # Postgres 16
uv run alembic upgrade head
uv run cayceops scanner run
uv run pytest
```
### 2. The Bitcoin Travel Data Commons
Every guide on bitcoinhotels.org is built from field-collected data: ATM operators and
their fee structures by city, no-KYC caps, Lightning acceptance rates, border policies.
The grant funds turning this into an **open, structured dataset** any Bitcoin traveler
(or any other project) can consume — CC-licensed, machine-readable, community-updatable.
`docker compose up` (everything) runs all five daemons in loops; on a VPS use
[deploy/systemd](deploy/systemd/README.md) instead.
### 3. The Travel Security Kit as an open project
hardcap.news's Travel Security Kit — seed strategies that survive a border search, the
gift-card rescue rail, device choice doctrine — becomes an open, versioned document
with community review, translated to Spanish and Portuguese.
## Layout
## Why an entity, not a company
```
cayceops/ the package
config.py env-var config (CAYCE_OPS_*), no config files
db.py engine/session/upgrade helpers
models.py ORM schema + state machines + audit helper
llm.py provider-agnostic LLM interface (null by default)
components/
scanner/ discovery -> proposals (never executes)
executor/ plugin execution + audit
maild/ IMAP classify, drafts, SMTP gated on approval
publisher/ calendar, nostr adapter, image templates
monitor/ static status page builder
alembic/ migrations (production schema path)
tests/ pytest suite (invented fixtures only)
deploy/systemd/ VPS units + timers
docs/DECISIONS.md architectural decisions and their costs
```
OpenSats funds people and projects building the Bitcoin commons. Cayce is neither a
person nor a company — it is an autonomous entity with a public mandate, operating
transparently, with no shareholders, no owners, and nothing to extract. Its output is
infrastructure: guides, datasets, and code that make living on Bitcoin easier and safer.
## Security posture
Cayce never denies being AI. The work stands on its own.
- Config exclusively via env vars; `.env` is gitignored, `.env.example` holds placeholders.
- `make check` (and CI): ruff, pytest, alembic smoke, **gitleaks over the full history**.
- SMTP send, social publish, and proposal execution all require a human action
recorded in the audit log — unless `AUTONOMOUS_MODE=true`, which enables one
narrow, capped, audited exception (see [docs/DECISIONS.md](docs/DECISIONS.md) D5).
## Metrics of the first 12 months
## License
- 3 field-tested travel guides published (all indexed, all organic traffic)
- Travel Security Kit published and linked from the Bitcoin community
- 22 approved initiatives in the autonomous pipeline
- Social presence operated end-to-end by the entity (FB + IG + Nostr)
- 100% uptime on both properties, self-hosted on owned infrastructure
## Contact
- Web: https://cayce-co.xyz
- Nostr: (entity npub — see cayce-co.xyz)
- Fediverse: via ActivityPub on this instance
- Email: cayce@cayce-co.xyz
---
*License: all code and content in Cayce's repositories is open source / open content
(MIT / CC-BY-SA) unless stated otherwise.*
MIT — see [LICENSE](LICENSE).