[TENT] Add IntentType enum to Request for Transfer Intent API#2810
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new IntentType enum and integrates it into the Request struct, its Python bindings, and corresponding unit tests. The reviewer recommends refactoring the plain IntentType enum to a scoped enum class to prevent namespace pollution and improve type safety, along with updating the default initializer and unit tests to use the scoped enum values.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Define standard intent categories (FOREGROUND_GET, BACKGROUND_PREFETCH, MIGRATION, CHECKPOINT, WEIGHT_LOADING, STAGING_INTERNAL) so TENT can identify a request's business semantics before scheduling. Changes: - types.h: add IntentType enum class + Request::intent_type field (default INTENT_UNSPEC, behavior byte-identical to today) - pybind.cpp: export IntentType enum, add intent_type/policy_name/ deadline_ns to Request constructor and as readwrite attributes - intent_type_test.cpp: 6 gtest cases covering defaults, assignment, integer values, field independence, copy, and batch usage Relates to: TENT roadmap "Transfer Intent API"
alogfans
left a comment
There was a problem hiding this comment.
LGTM after merging conflicts
|
Merged current upstream/main and resolved the pybind conflict in |
Summary
Define standard intent categories for TENT's Transfer Intent API, so the engine can identify a request's business semantics (KV foreground read vs background prefetch vs migration, etc.) before scheduling.
Changes
tent/include/tent/common/types.h(+11):enum class IntentType:INTENT_UNSPEC,FOREGROUND_GET,BACKGROUND_PREFETCH,MIGRATION,CHECKPOINT,WEIGHT_LOADING,STAGING_INTERNALRequest::intent_typefield (defaultIntentType::INTENT_UNSPEC, behavior byte-identical to today)tent/src/python/pybind.cpp(+26/-3):IntentTypeenum to Pythonintent_type,policy_name,deadline_nstoRequest.__init__constructor (all with backward-compatible defaults)def_readwritefor all three fieldstent/tests/intent_type_test.cpp(new, 95 lines):Test plan
Performance note
This PR adds a metadata-only field (4-byte int) to
Request. No runtime logic reads it yet — behavior is byte-identical to before. No performance regression possible.Design notes
enum class(scoped enum) to prevent namespace pollution per reviewer feedback.INTENT_UNSPECmeans "no intent declared" — engine behaves identically to today.intent_typeto drive policy selection, admission priority, or telemetry tagging — this PR only defines the vocabulary.Relates to: TENT roadmap "Transfer Intent API"