feat: gamemaster

This commit is contained in:
Ilia Denisov
2026-05-03 07:59:03 +02:00
committed by GitHub
parent a7cee15115
commit 3e2622757e
229 changed files with 41521 additions and 1098 deletions
@@ -0,0 +1,50 @@
package registerruntime
// Stable error codes returned in `Result.ErrorCode`. The values match the
// vocabulary frozen by `gamemaster/README.md §Error Model` and
// `gamemaster/api/internal-openapi.yaml`. Service-layer stages 14-17
// import these names rather than redeclare them; renaming any of them is
// a contract change.
const (
// ErrorCodeInvalidRequest reports that the request envelope failed
// structural validation (empty required fields, unknown enum values,
// malformed turn schedule).
ErrorCodeInvalidRequest = "invalid_request"
// ErrorCodeConflict reports that a runtime record already exists for
// the requested game id (idempotent re-registration not supported in
// v1) or that a CAS guard failed mid-flow because the row changed
// concurrently.
ErrorCodeConflict = "conflict"
// ErrorCodeEngineVersionNotFound reports that the requested
// `target_engine_version` is not present in the engine_versions
// registry. Returned before any engine call is attempted.
ErrorCodeEngineVersionNotFound = "engine_version_not_found"
// ErrorCodeEngineUnreachable reports that the engine /admin/init call
// returned a 5xx status, timed out, or could not be dispatched. The
// runtime_records and player_mappings rows are rolled back before
// the error reaches the caller.
ErrorCodeEngineUnreachable = "engine_unreachable"
// ErrorCodeEngineValidationError reports that the engine /admin/init
// call returned a 4xx status. Distinguished from
// `engine_unreachable` so the operator knows the engine is
// reachable but rejected the request shape (per Stage 13 D1).
ErrorCodeEngineValidationError = "engine_validation_error"
// ErrorCodeEngineProtocolViolation reports that the engine response
// did not match the expected schema or did not match the input
// roster (player count mismatch, race-name set mismatch, missing
// required fields).
ErrorCodeEngineProtocolViolation = "engine_protocol_violation"
// ErrorCodeServiceUnavailable reports that a steady-state dependency
// (PostgreSQL, Redis) was unreachable for this call.
ErrorCodeServiceUnavailable = "service_unavailable"
// ErrorCodeInternal reports an unexpected error not classified by the
// other codes.
ErrorCodeInternal = "internal_error"
)