Development workflow
Commands
Section titled “Commands”# Compile and run against ./db (initializes on first run)./run.sh
# Compile onlycd src && osl compile main.osl -o ../originchats-osl
# Format all OSL sourcescd src && osl fmt .
# Fetch the recorded Go dependency setcd src && go mod downloadUse two-space indentation and the formatter. Functions and locals use camelCase, constants use uppercase snake case, and protocol commands/handler filenames use snake case. Prefer short, specific variables and intermediate values that make conditions readable. Avoid dense expressions and monolithic files.
Before creating an abstraction, look for an existing focused module. Database behavior, permission checks, validation, public serialization, and transport handling should remain separated.
Change checklist
Section titled “Change checklist”- Handler file, function name, and
cmdstring match. - Handler always accepts connection/message and returns an array.
- Input is schema-validated before assertion or normalization.
- Shared rules are not duplicated.
- Persistence failure leaves memory and disk consistent.
- Administrative changes are audited.
- Channel changes refresh affected clients.
- Broadcasts include a channel and do not expose
global. - Dispatcher and handshake capability list agree.
- Runtime
db/and generated binary remain untracked. - Build passes after formatting.
Keep commits focused with short lowercase present-tense summaries. For protocol changes, include request/response examples and verification in the pull request.
