feat(server): target-bearing runtime resolution (3/7)#181
Draft
abhinav-galileo wants to merge 1 commit intoabhi/rfc-1-1-pr2-target-apisfrom
Draft
feat(server): target-bearing runtime resolution (3/7)#181abhinav-galileo wants to merge 1 commit intoabhi/rfc-1-1-pr2-target-apisfrom
abhinav-galileo wants to merge 1 commit intoabhi/rfc-1-1-pr2-target-apisfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4 tasks
23b990f to
46ed17b
Compare
24b421b to
55a647d
Compare
46ed17b to
fe437c4
Compare
55a647d to
5222252
Compare
fe437c4 to
7067673
Compare
1f581f1 to
41e3d21
Compare
EvaluationRequest now accepts optional target_type + target_id. When both are set, the server resolves the target row via (tenant_id, target_type, external_id) and merges target_controls into the effective set. Direct agent controls and policy-derived controls mask any target-level setting; target_controls with enabled=true contribute otherwise. Missing target returns 404. No-target requests remain unchanged.
41e3d21 to
af42b84
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on top of #180. Kept in draft until the full stack has been validated end-to-end.
Summary
EvaluationRequestwith optionaltarget_typeandtarget_id(both or neither; validated by a model validator).(tenant_id, target_type, external_id)when supplied.target_controlsinto the effective runtime control set when a target is present.Resolution semantics
union(direct_agent, policy_derived, enabled_target_controls).control_id; agent/policy rows effectively mask target rows when the same control appears from multiple sources (agent-level attachment takes precedence over target-level state).target_controls.enabled=falsehides the control from the effective set only when target is the sole source; an agent/policy attachment for the same control still activates it.TARGET_NOT_FOUND. Lazy upsert is explicitly deferred to a later PR.Scope boundaries
EvaluationRequestmodel now serializestarget_type/target_idasnullwhen unset; this is a test-fixture adjustment, not a behavior change.Performance notes
(target_id, enabled).(tenant_id, target_type, external_id)unique constraint.Test plan
make checkclean locally (1490 tests across packages; 553 server including 9 new target-resolution tests)target_typefails 422, onlytarget_idfails 422