Skip to content

Development workflow

Terminal window
# Compile and run against ./db (initializes on first run)
./run.sh
# Compile only
cd src && osl compile main.osl -o ../originchats-osl
# Format all OSL sources
cd src && osl fmt .
# Fetch the recorded Go dependency set
cd src && go mod download

Use 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.

  • Handler file, function name, and cmd string 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.