canary/docs
Eduardo Dantas 1789d5f97f
docs(agents): route build validation workflow (#4089)
Keep Canary's active repository instructions concise while moving the complete local build-validation workflow into dedicated documentation.

Main changes:
- Reduce detailed build procedures in AGENTS.md and route them through docs/building/local-validation.md.
- Keep repository-wide build invariants in the always-loaded instruction layer.
- Require maintained build entry points to stay synchronized when C++ source or header files are added, removed, or renamed.
- Keep the relevant CMakeLists.txt, vcproj/canary.vcxproj, and test CMakeLists.txt registration requirements explicit.
- Clarify that local builds remain opt-in unless explicitly requested or authorized at the completion point of a larger task.

Local validation documentation:
- Add docs/building/local-validation.md.
- Document the supported Windows CMake and Visual Studio validation workflow.
- Document Visual Studio Developer Command Prompt and Developer PowerShell environment requirements.
- Document project-managed VCPKG_ROOT verification before configuring or building.
- Document the preferred windows-release preset workflow.
- Document how to inspect and reuse existing CMake preset caches.
- Document targeted recovery from incompatible or corrupted CMake/Ninja cache state.
- Avoid broad cache deletion or creating ad-hoc build directories as a recovery path.
- Document maintained Visual Studio solution and generated build entry-point checks.

MSVC Ninja dependency tracking:
- Document that Ninja requires matching raw cl.exe /showIncludes output to populate .ninja_deps correctly.
- Require configure and build steps to use a consistent environment and code page.
- Keep compiler launchers disabled for MSVC Ninja validation.
- Document diagnosis using rules.ninja, msvc_deps_prefix, raw /showIncludes output, and ninja -t deps.
- Clarify that ninja -t recompact cannot recreate missing dependency records.
- Document recovery for malformed or empty .ninja_deps without broad-cleaning build state.

Instruction budget:
- Keep detailed workflows out of the always-loaded AGENTS.md when they can be routed to versioned documentation.
- Preserve headroom for global and narrower scoped instructions.
- Prefer removing duplicated guidance before increasing instruction byte limits.

Validation:
- Audited the effective global and repository instruction chain at 18,449 bytes.
- Verified it remains below the 24 KiB maintenance target and default Codex instruction cap.
- Verified the routed local-validation documentation path exists.
- Reviewed the complete committed diff.
- Ran Git whitespace validation successfully.
- No build was run because this is a documentation-only change and no build was requested.

This keeps the active instruction layer smaller while preserving the full Canary build-validation, cache-recovery, and MSVC Ninja dependency-tracking workflow in a dedicated maintained document.
2026-08-15 00:56:10 -03:00
..
building docs(agents): route build validation workflow (#4089) 2026-08-15 00:56:10 -03:00
development build: share content-addressed vcpkg dependencies across CMake and MSBuild (#4079) 2026-08-13 18:50:05 -03:00
docker feat(protocol): add runtime multiprotocol client profiles (#4009) 2026-07-01 13:14:58 -03:00
lua-api feat(pvp): add Expert PvP world type and combat rules (#4033) 2026-08-10 18:42:55 -03:00
maps perf: improve Canary startup loading performance (#3968) 2026-05-22 16:58:43 -03:00
python-scripts improve: player components to scoped object (#3130) 2025-03-18 09:45:48 -03:00
systems fix(network): retry rejected protocol cleanup (#4073) 2026-08-12 16:03:36 -03:00
architecture.md docs: reorganize and update project documentation (#4008) 2026-06-11 20:17:07 -03:00
canary-logo-transparent.png fix: update donate link and add canary logo png files (#903) 2023-03-06 19:10:43 -03:00
canary-logo.png fix: update donate link and add canary logo png files (#903) 2023-03-06 19:10:43 -03:00
config.ld.in Initial commit 2021-04-26 21:04:01 -03:00
crypto-backend-evaluation.md improve: migrate RSA backend from OpenSSL to Mbed TLS (#3938) 2026-05-06 08:45:24 -03:00
development.md build: pin vcpkg registry and developer tools (#4052) 2026-08-05 09:07:02 -03:00
Doxyfile.in Initial commit 2021-04-26 21:04:01 -03:00
operations.md docs: reorganize and update project documentation (#4008) 2026-06-11 20:17:07 -03:00
README.md feat(audit): add profile-aware content reference validation (#4031) 2026-07-13 20:47:00 -03:00
release.md ci(release): materialize tags before publishing (#4006) 2026-06-10 00:10:14 -03:00

Canary Documentation

This directory is the main documentation hub for the Canary repository.


Documentation Index

This documentation is organized around four primary guides, with specialized references in the surrounding subdirectories:

Document Purpose
README.md Project overview and documentation index
architecture.md System design, components and technical architecture
development.md Development environment, coding standards and contribution workflow
operations.md Deployment, monitoring, security, backups and production operations
systems/content-reference-auditor.md Profile-aware gameplay content and identifier auditing

What is Canary?

Canary is a modern MMORPG server engine that evolved from the OTServBR ecosystem. The project aims to provide a clean, maintainable, and extensible codebase that supports both custom game projects and OpenTibia-based servers. The repository includes support for multiple datapacks, Lua scripting, database persistence, a Docker quickstart for local testing, automated testing and observability tooling.

Key characteristics:

  • C++20 core engine
  • Lua gameplay scripting
  • MariaDB/MySQL persistence
  • Docker quickstart support for local testing and LAN demos
  • Automated testing
  • Metrics and observability
  • Optional OpenTelemetry metrics integration
  • Multiple datapack support
  • Modern build tooling using CMake and vcpkg

Documentation Structure

docs/
├── README.md
├── architecture.md
├── development.md
├── operations.md
├── building/
├── docker/
├── lua-api/
└── systems/

Architecture Guide

The Architecture Guide explains how Canary is built internally.

Topics include:

  • High-level system architecture
  • Core engine design
  • Networking layer
  • Protocol handling
  • Creature system
  • Combat engine
  • Map management
  • Lua integration
  • Database architecture
  • Event system
  • Scheduler and dispatcher
  • Metrics and observability

Read the Architecture Guide.

Recommended for:

  • Engine contributors
  • System designers
  • Technical reviewers
  • Advanced server developers

Development Guide

The Development Guide explains how to build, test and contribute to Canary.

Topics include:

  • Development environment setup
  • Docker development workflow
  • Native compilation
  • CMake usage
  • vcpkg dependency management
  • Lua development
  • C++ coding standards
  • Testing practices
  • Pull request workflow
  • Debugging techniques

Read the Development Guide.

Recommended for:

  • Contributors
  • Developers
  • Lua scripters
  • Engine maintainers

Operations Guide

The Operations Guide focuses on operating Canary safely, including native production deployments and the limits of the local Docker quickstart.

Topics include:

  • Infrastructure planning
  • Deployment models
  • Docker quickstart operations
  • Configuration management
  • Security practices
  • Monitoring and alerting
  • Backup strategies
  • Disaster recovery
  • Upgrade procedures
  • Incident response

Read the Operations Guide.

Recommended for:

  • Server administrators
  • DevOps engineers
  • Infrastructure teams
  • Community operators

Repository Overview

canary/
│
├── src/                    # C++ server source code
├── data/                   # Core shared server resources
├── data-canary/            # Minimal Canary datapack
├── data-otservbr-global/   # Global datapack
├── docs/                   # Project documentation
├── tests/                  # Automated tests
├── docker/                 # Local Docker quickstart assets
├── metrics/                # Observability and metrics
│
├── schema.sql              # Database schema
├── config.lua.dist         # Configuration template
├── CMakeLists.txt          # Build configuration
├── CMakePresets.json       # Build presets
└── vcpkg.json              # Dependency manifest

The project supports both the lightweight data-canary datapack and the larger data-otservbr-global datapack, allowing operators to choose between a minimal engine-focused setup and a more complete game experience.


Typical Lifecycle

The documentation follows the same lifecycle as a Canary deployment:

Architecture
      ↓
Development
      ↓
Testing
      ↓
Deployment
      ↓
Operations
      ↓
Monitoring
      ↓
Maintenance

Technology Stack

Core Technologies

  • C++20
  • Lua
  • MariaDB / MySQL
  • CMake
  • vcpkg

Infrastructure

  • Docker Compose quickstart
  • GitHub Actions
  • OpenTelemetry-based metrics
  • Prometheus and Grafana examples

Supported Platforms

  • Linux
  • Windows
  • macOS

Deployment Options

Canary can be run using:

Docker

Recommended for:

  • Local development
  • Testing
  • LAN demos

The repository Docker Compose stack is a quickstart. It uses the published Canary runtime image, builds the MyAAC quickstart image, and should not be used as a production deployment with default settings. See docker/DOCKER.md for the complete quickstart contract.

Native Installation

Recommended for:

  • Production environments
  • Custom infrastructure
  • Advanced monitoring setups

The repository provides Docker quickstart assets, CMake build presets and operational guidance for these approaches.


Contributing

Contributors are encouraged to:

  • Report bugs
  • Improve documentation
  • Write tests
  • Submit pull requests
  • Improve Lua systems
  • Enhance engine functionality

Before contributing:

  1. Read architecture.md
  2. Read development.md
  3. Follow coding standards
  4. Run tests locally
  5. Update documentation when necessary

Additional Resources


Audience Guide

Role Recommended Reading
New Contributor README → Development
Lua Developer README → Development
Engine Developer README → Architecture → Development
DevOps Engineer README → Operations
Server Administrator README → Operations
Technical Lead README → Architecture → Operations

Conclusion

The Canary documentation is organized around three core perspectives:

  • Architecture — how the system works
  • Development — how the system is built
  • Operations — how the system is run

Together, these documents provide a complete reference for understanding, extending, deploying and operating Canary in both development and production environments.