feat(core): add context accessor functions (F-CP-06)#91
Merged
eterna2 merged 1 commit intorelease/v0.4.0from Apr 24, 2026
Merged
feat(core): add context accessor functions (F-CP-06)#91eterna2 merged 1 commit intorelease/v0.4.0from
eterna2 merged 1 commit intorelease/v0.4.0from
Conversation
b56ab1f to
9da6f3f
Compare
3b9b78a to
730c226
Compare
Implement the five public context accessor functions required by SPEC-v0.3.0 §2.8 F-CP-06: - get_current_user() — reads kest.user from OTel Baggage - get_current_agent() — reads kest.agent from OTel Baggage - get_current_task() — reads kest.task from OTel Baggage - get_current_jwt() — reads kest.jwt (existing, now typed + exported) - get_current_passport()— reads kest.passport (existing, now typed + exported) Changes: - Add 3 new accessors + type-safe _get_baggage_str helper to context.py - Add type hints and docstrings to existing 2 accessors - Export all 5 from kest.core.__init__.py - 10 unit tests (TDD: 2 per accessor — present + absent) - Gitignore drafts/ directory
730c226 to
a9b67e1
Compare
eterna2
added a commit
that referenced
this pull request
Apr 25, 2026
Implement the five public context accessor functions required by SPEC-v0.3.0 §2.8 F-CP-06: - get_current_user() — reads kest.user from OTel Baggage - get_current_agent() — reads kest.agent from OTel Baggage - get_current_task() — reads kest.task from OTel Baggage - get_current_jwt() — reads kest.jwt (existing, now typed + exported) - get_current_passport()— reads kest.passport (existing, now typed + exported) Changes: - Add 3 new accessors + type-safe _get_baggage_str helper to context.py - Add type hints and docstrings to existing 2 accessors - Export all 5 from kest.core.__init__.py - 10 unit tests (TDD: 2 per accessor — present + absent) - Gitignore drafts/ directory
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.
Summary
Closes #76
Implements the five public context accessor functions required by SPEC-v0.3.0 §2.8 F-CP-06.
Changes
libs/kest-core/python/src/kest/core/framework/context.pyget_current_user(),get_current_agent(),get_current_task()_get_baggage_str()helper (narrowsobject | None→str | None)get_current_jwt()andget_current_passport()libs/kest-core/python/src/kest/core/__init__.py__all__libs/kest-core/python/src/kest/core/framework/context_test.py.gitignoredrafts/to gitignoreTest Results
Spec Compliance
get_current_user()kest.userget_current_agent()kest.agentget_current_task()kest.taskget_current_jwt()kest.jwtget_current_passport()kest.passport