Replace the single file-structure.md with a stratified layout designed
for AI/agent skill consumption: tables and concrete identifiers over
prose, files loaded on demand, content separated by churn rate.
Layers:
- architecture/ stable structural reference (overview, source-map,
test-map, data-flow)
- patterns/ memory, commands, autocomplete, events, xmpp,
encryption, ui, plugins
- testing/ unit-tests, stubs, functional-tests, bench
- build/ local, docker, ci
- playbooks/ add-command, add-test, add-autocomplete,
add-event-handler, add-encryption
- gotchas.md append-only dated entries (seven seed entries)
- wip/ branch-specific notes; deleted on merge to master
Stable layers describe cproof on master only. In-flight feature
branches (currently feat/ai) get a single file under wip/.
INDEX.md is the entry map with churn labels; SKILL.md is the
always-loaded skill hint pointing to it.
60 lines
2.4 KiB
Markdown
60 lines
2.4 KiB
Markdown
# Overview
|
|
|
|
## What cproof is
|
|
|
|
- Terminal-based XMPP (chat) client written in C.
|
|
- Fork of [Profanity](https://github.com/profanity-im/profanity); rename to
|
|
cproof is **work in progress** — many internal symbols, copyright headers,
|
|
and identifiers still say "Profanity".
|
|
- Heavy GLib usage (strings, lists, hash tables, key files).
|
|
- Optional integrations: OMEMO (libsignal-protocol), OTR (libotr), PGP/OX
|
|
(gpgme), Python plugins, libnotify, libgcrypt, libreadline, ncurses.
|
|
|
|
## Build system
|
|
|
|
- Autotools: `configure.ac` + a top-level `Makefile.am`. No CMake.
|
|
- `autogen.sh` regenerates the configure script.
|
|
- `configure-debug` is a thin helper that invokes `./configure` with
|
|
debug-friendly flags.
|
|
- Canonical build environment: Docker (`Dockerfile.debian` at repo root).
|
|
See `build/docker.md`.
|
|
|
|
## Test framework
|
|
|
|
- **Unit tests:** cmocka, run via `make check`. Live in `tests/unittests/`.
|
|
- **Functional tests:** custom runner in `tests/functionaltests/` against a
|
|
real running cproof instance.
|
|
- **Benches:** custom runners in `tests/bench/<runner>/` for database /
|
|
flatfile / long-message workloads.
|
|
- See `architecture/test-map.md` and the `testing/` directory for detail.
|
|
|
|
## High-level module split
|
|
|
|
Source lives under `src/` in module directories — see
|
|
`architecture/source-map.md` for the full table. Major chunks:
|
|
|
|
- **Command layer** (`src/command/`) — `/foo`-style commands the user types.
|
|
- **XMPP layer** (`src/xmpp/`) — protocol, sessions, stanza building.
|
|
- **UI layer** (`src/ui/`) — windows, buffers, status bar, input.
|
|
- **Event layer** (`src/event/`) — bridges between XMPP and UI / commands.
|
|
- **Encryption** (`src/omemo/`, `src/otr/`, `src/pgp/`) — three independent
|
|
encryption stacks.
|
|
- **Plugins** (`src/plugins/`) — C and Python plugin APIs.
|
|
- **Tools** (`src/tools/`) — generic utilities (parser, autocomplete, HTTP,
|
|
clipboard, editor).
|
|
|
|
Active feature branches (e.g. `feat/ai`, which adds `src/ai/`) are not
|
|
described in the stable architecture files. See `wip/` for branch-specific
|
|
notes.
|
|
|
|
## Entry points
|
|
|
|
| File | Role |
|
|
|---|---|
|
|
| `src/main.c` | Process entry. |
|
|
| `src/profanity.c` | Application init/shutdown lifecycle. |
|
|
| `src/common.h` | Project-wide macros (`auto_*`, `FREE_SET_NULL`, `ARRAY_SIZE`). |
|
|
| `src/database.c` / `src/database.h` | Database (SQLite + flatfile) abstraction. |
|
|
| `src/chatlog.c` | Chat history persistence. |
|
|
| `src/log.c` | Application log. |
|