Embedded repo was committed as submodule (160000). Now includes all guardrails files directly for full in-repo reference. Authored by TheArchitectit |
||
|---|---|---|
| .. | ||
| cpp/unreal-ui | ||
| csharp/unity-ui | ||
| flutter/cross-platform | ||
| gdscript/godot-game | ||
| go | ||
| java | ||
| php/laravel-ui | ||
| python | ||
| r/game-analytics | ||
| regression-prevention | ||
| ruby | ||
| rust | ||
| scala/functional-ui | ||
| swift/swiftui-game | ||
| typescript | ||
| README.md | ||
README.md
Example Implementations
Reference implementations demonstrating guardrails-compliant testing patterns.
Purpose: These examples show how to implement the testing and validation protocols described in AGENT_GUARDRAILS.md across different programming languages.
Available Examples
| Language | Directory | Test Framework | Key Patterns |
|---|---|---|---|
| TypeScript | typescript/ |
Jest | Logging hooks, retry logic |
| Python | python/ |
pytest | Config loading, environment separation |
| Go | go/ |
go test | Config validation, environment handling |
| Rust | rust/ |
cargo test | Config loading with Result types |
| Ruby | ruby/ |
RSpec | Config loader with environment support |
| Java | java/ |
JUnit 5 | ConfigLoader with environment injection |
| C# | csharp/ |
xUnit | ConfigLoader with IConfiguration |
| Swift | swift/ |
XCTest | ConfigLoader with Codable |
| Elixir | elixir/ |
ExUnit | Config loading with Mix environments |
| Scala | scala/functional-ui/ |
scala-cli | Functional UI composition, type-safe CSS, DDA telemetry |
| R | r/game-analytics/ |
Rscript | ggplot2 4.0+, Shiny 2.0+, ethics auditing, retention analysis |
Key Concepts Demonstrated
1. Test/Production Separation
Each example demonstrates:
- Separate configuration files for test vs production
- Environment-specific database connections
- Isolated test infrastructure
2. Production Code First
Following guardrails, each example:
- Implements production code in
src/orlib/ - Adds test code in
tests/ortest/ - Uses language-idiomatic test patterns
3. Environment-Specific Configuration
config/
├── production.yaml # Production settings
├── test.yaml # Test settings
└── development.yaml # Development settings
Running Examples
TypeScript
cd typescript
npm install
npm test
Python
cd python
pip install -e ".[dev]"
pytest
Go
cd go
go test ./...
Rust
cd rust
cargo test
Ruby
cd ruby
bundle install
bundle exec rspec
Java
cd java
./gradlew test
C#
cd csharp
dotnet test
Swift
cd swift
swift test
Elixir
cd elixir
mix deps.get
mix test
Scala
cd scala/functional-ui
scala-cli run UI.scala
scala-cli run data-pipeline-viz.scala
scala-cli run procedural-gen.scala
R
cd r/game-analytics
Rscript shiny-dashboard.R
Rscript retention-analysis.R
Rscript ethics-auditor.R
Shiny Dashboard (R Web Server)
Rscript -e "shiny::runApp('r/game-analytics')"
Guardrails Compliance
All examples follow:
| Rule | Implementation |
|---|---|
| PRODUCTION FIRST | Production code exists before tests |
| SEPARATE DATABASES | Config files use different DB hosts per environment |
| SEPARATE SERVICES | Service endpoints differ by environment |
| NO TEST USERS IN PROD | Test users have test_ prefix |
| CLEAR LABELING | Test files follow *_test.* or *.test.* convention |
Related Documentation
- AGENT_GUARDRAILS.md - Core safety protocols
- TEST_PRODUCTION_SEPARATION.md - Separation standards
- TESTING_VALIDATION.md - Validation protocols
- SPRINT_TEMPLATE.md - Language-specific commands
Last Updated: 2026-01-18