opik-mcp

0004 — Entity logic lives in its namespace

Status: accepted, 2026-09-23 (OPIK-8485)

Decision

All logic for one entity or write operation lives in that entity’s or operation’s namespace. A package root holds only protocols, base classes, registries and generic mechanisms. That includes tables: per-entity OQL fields, sort fields, URI patterns and link builders belong with the entity, reached through a hook on its handler.

If a change for one entity has to touch the root, the framework is missing a hook. Add the hook, and say so in the PR.

Why

A root module that knows every entity changes in every PR, however narrow the PR is. A root that only dispatches rarely changes, so it is easy to extend and to review. Raised in review of #186 and #187.

Enforced by

Log