Superheap is a Rust CLI with its entry point in src/main.rs, delegating shared logic to src/lib.rs. Domain-specific modules live alongside it: src/server.rs handles the SMTP bridge, src/generator.rs renders RSS, src/db.rs wraps the SQLite layer, and src/types.rs defines shared data structures. Example configs are under configs/, while data/ is reserved for locally generated feeds or the SQLite store (never commit secrets from this directory).
cargo build: Compile the binary; add--releasebefore deploying cron jobs.cargo run -- serve --config configs/superheap.json: Start the SMTP listener using the sample config.cargo run -- generate --config configs/superheap.json: Produce RSS output for all tracked feeds.cargo test: Execute unit and integration tests across the workspace.cargo fmt && cargo clippy --all-targets --all-features: Format and lint in one go before opening a PR.
Follow standard Rust style (four-space indentation, snake_case for functions and files, PascalCase for types). Always run cargo fmt to enforce formatting and address cargo clippy findings or explicitly justify ignored lints. Prefer small, composable functions in the existing module boundaries, and colocate helper tests within the module guarded by #[cfg(test)].
Use Rust's built-in test harness via cargo test; write unit tests next to the code they cover and add integration tests under tests/ if behavior spans modules. Aim to cover new branches that touch IO (database, filesystem, or mail parsing) with either mocks or fixture emails in data/. Keep test names descriptive, using the function_under_test_condition_expected() pattern.
Commit subjects should be imperative and under 65 characters (examples in history include bug: Fix feed generation to order by id desc). Reference issues in the body when relevant and note config or migration steps. For pull requests, provide a short problem statement, a bullet list of changes, and any screenshots or sample RSS snippets when output changes. Confirm CI status, lint/test results, and configuration updates (e.g., new cron steps) before requesting review.