Repository navigation
feat(OMN-14058): add optional tenant_id to delegation wire DTOs [OPERATOR-ACCEPTED INTERIM] - #1404
Conversation
…ATOR-ACCEPTED INTERIM] Adds an OPTIONAL tenant_id field to ModelDelegationRequest and ModelDelegationResult so the delegation FSM (omnimarket) can thread a real tenant identity through the request/terminal wire boundary instead of delegation/savings projection rows silently landing under the shared 'omninode' column default. OPERATOR-ACCEPTED INTERIM per OMN-14058 (beta-blocking tenant attribution). The durable per-tenant identity design is tracked separately as OMN-14107; this is the pragmatic beta fix, not the final design. Both models are frozen + extra="forbid"; tenant_id is added as Field(default=None) (not a bare `= None`) so no existing serialization or substrate-gate behavior changes. No golden-chain fixture impact: request_hash only projects model/messages/max_tokens/temperature.
📝 WalkthroughWalkthroughTwo delegation wire model files receive a new optional ChangesTenant ID Field Addition
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
|
Cross-repo heads-up (independent adversarial verification of the companion omnimarket PR #1648): The wire-DTO Once A migration + real-Postgres regression test is in flight under OMN-14058 (source of truth in omnimarket's node migration dirs, vendored into omnibase_infra). Not a blocker for this PR's DTO change specifically, but the omnimarket companion (#1648) should not merge/deploy until that migration lands — flagging here since this PR is the dependency root of that chain. |
Summary
OMN-14058 (beta-blocking): delegation/savings projection rows land under
tenant_id='omninode'(the omnidash-side column default,omnidash/db/migrations/0001_tenant_rls.sql) because no tenant identity exists anywhere in the delegation chain today. OPERATOR-ACCEPTED INTERIM FIX — the operator explicitly accepted this pragmatic path for beta; the durable per-tenant identity design is tracked separately as OMN-14107 and is out of scope here.This PR is the omnibase_core half: it adds an OPTIONAL
tenant_idfield to the two canonical delegation wire DTOs so the omnimarket delegation FSM can thread a real tenant identity end-to-end. Companion omnimarket PR threadsONEX_TENANT_ID(read once at request-acceptance) through the FSM and stamps it onto the delegation/savings projection rows.Changes
ModelDelegationRequest(models/delegation/wire/model_delegation_wire_request.py):tenant_id: str | None = Field(default=None, ...).ModelDelegationResult(models/delegation/wire/model_delegation_result.py): same.frozen=True, extra="forbid"— the field is additive/optional so no existing serialization or validation behavior changes.Field(default=None)(not a bare= None) so thesubstrate-identity-field-optionalitypre-commit gate (which only flags a bare-constantNonedefault onIDENTITY_FIELD_NAMES, andtenant_idis in that set) does not fire — verified locally by running the gate script directly against both files.Golden-chain impact
None.
canonical_request_hash(runtime/golden_chain/recorded_replay_transport.py) only projectsmodel,messages,max_tokens,temperature—tenant_idis not part of that projection, so no fixture re-record is needed (omnimarket/tests/fixtures/golden_chain/*).Verification
uv run pytest tests/unit/models/delegation/ -q— 181 passed.uv run ruff format --check/uv run ruff checkon both changed files — clean.uv run mypyon both changed files —Success: no issues found in 2 source files.pre-commit run --files <both files>— all hooks passed (substrate gates, ai-slop, pydantic-pattern, etc.).pytest tests/in progress at push time (background); will report final tail if requested.Dependency note
This is a cross-repo interim fix. The companion omnimarket PR imports
omnibase_core.models.delegation.wire.ModelDelegationRequest/ModelDelegationResultand depends on this field existing — omnimarket's CI will not go fully green until this PR merges, releases, and theomnibase-corepin in omnimarket'spyproject.toml/uv.lockis bumped (the standardrepin omnibase-core X -> Yfollow-up, same pattern as recent PR history in that repo).OCC / DoD
Per lane instructions: NOT self-authoring an OCC Evidence-Source companion (a parallel lane is fixing OCC-companion autogen; see memory
feedback_no_self_authored_evidence). This PR needs an independent OCC companion + dod_evidence on OMN-14058 before it can merge — that dependency is flagged, not resolved, here.Closes OMN-14058 (partially — omnibase_core half only; see companion omnimarket PR for the FSM + projection threading).
No merge, no deploy — this PR is queued for independent adversarial review per the dispatching lane's instructions.
Summary by CodeRabbit
Evidence-Source: OCC#3726
Evidence-Ticket: OMN-14058