Files
oikos/internal/domain/errors.go
dtoro 1bfc18ea3a phase 2 (part 4): SSE stream via io.Pipe, OIDC JWT auth middleware
- SSE stream: GET /events/stream using io.Pipe to bridge the SSE
  goroutine to the response body. Replay from Last-Event-ID via
  in-memory broker with DB fallback. LISTEN/NOTIFY fan-out to all
  subscribers. Heartbeat every 15s. Bounded channels.
- OIDC JWT auth: validates Bearer tokens against Authentik/OIDC
  issuer via JWKS discovery + key caching. Extracts sub/email into
  context actor. Falls back to static bearer tokens. Dev mode (no
  OIDC + no tokens) = open.
- Config: OIDCIssuer, OIDCClientID env vars
- SSE + OIDC infrastructure complete, build passes, all tests pass

Remaining: MCP server, conformance tests, wire audit middleware
2026-07-07 09:40:11 +02:00

23 lines
1.1 KiB
Go

package domain
import "errors"
// Sentinel errors. Used throughout the codebase for typed error handling.
// The API middleware maps these to HTTP status codes (SG11).
var (
ErrNotFound = errors.New("entity not found")
ErrInvalidTransition = errors.New("invalid lifecycle transition")
ErrApprovalRequired = errors.New("operator approval required")
ErrAutonomyBlocked = errors.New("autonomy policy blocks this action")
ErrConflict = errors.New("concurrent modification conflict")
ErrCircuitOpen = errors.New("circuit breaker open for target")
ErrAbstractType = errors.New("cannot instantiate abstract entity type")
ErrInvalidEdge = errors.New("relationship endpoint type mismatch")
ErrCardinality = errors.New("relationship cardinality violation")
ErrSeedHashMismatch = errors.New("seed content hash mismatch")
ErrAlreadyExists = errors.New("entity already exists")
ErrQuarantined = errors.New("pattern is quarantined")
ErrSkillDeprecated = errors.New("skill is deprecated")
ErrInvalidInput = errors.New("invalid input")
)