Type
Documentation
Priority
P3
Newcomer impact
A newcomer who reads help(agent_kernel) (a natural first move) and the module's top-of-file docstring will think TokenRevoked, AdapterParseError, CapabilityAlreadyRegistered, and HandleConstraintViolation are not part of the public API. They are.
Evidence
src/agent_kernel/__init__.py:36-42 — docstring's Errors:: block lists:
AgentKernelError, TokenExpired, TokenInvalid, TokenScopeError,
PolicyDenied, PolicyConfigError, DriverError, FirewallError,
BudgetExhausted, BudgetConfigError,
CapabilityNotFound, HandleNotFound, HandleExpired
__all__ (__init__.py:139-155) also exports: TokenRevoked, AdapterParseError, CapabilityAlreadyRegistered, HandleConstraintViolation.
- Verified:
python -c "from agent_kernel import HandleConstraintViolation; print(HandleConstraintViolation)" works fine.
Steps to reproduce
python -c "import agent_kernel; help(agent_kernel)" (or read the file).
- Note the
Errors:: block in the docstring omits four publicly-exported error classes.
Proposed fix
Add the four missing names to the Errors:: block in the module docstring at src/agent_kernel/__init__.py:36-42:
from agent_kernel import (
AgentKernelError,
TokenExpired, TokenInvalid, TokenScopeError, TokenRevoked,
PolicyDenied, PolicyConfigError,
DriverError, FirewallError, AdapterParseError,
BudgetExhausted, BudgetConfigError,
CapabilityNotFound, CapabilityAlreadyRegistered,
HandleNotFound, HandleExpired, HandleConstraintViolation,
)
Implementation notes for AI
- Likely files to inspect/change:
src/agent_kernel/__init__.py only.
- Relevant tests to add or update: optional — a
tests/test_public_api.py that asserts every name in __all__ also appears in the module docstring would prevent future drift.
- Edge cases: keep the docstring grouped by topic the way it is.
Acceptance criteria
Duplicate check
Searched open issues for: __all__, public API, docstring, TokenRevoked, HandleConstraintViolation.
Result: no open duplicate.
Type
Documentation
Priority
P3
Newcomer impact
A newcomer who reads
help(agent_kernel)(a natural first move) and the module's top-of-file docstring will thinkTokenRevoked,AdapterParseError,CapabilityAlreadyRegistered, andHandleConstraintViolationare not part of the public API. They are.Evidence
src/agent_kernel/__init__.py:36-42— docstring'sErrors::block lists:__all__(__init__.py:139-155) also exports:TokenRevoked,AdapterParseError,CapabilityAlreadyRegistered,HandleConstraintViolation.python -c "from agent_kernel import HandleConstraintViolation; print(HandleConstraintViolation)"works fine.Steps to reproduce
python -c "import agent_kernel; help(agent_kernel)"(or read the file).Errors::block in the docstring omits four publicly-exported error classes.Proposed fix
Add the four missing names to the
Errors::block in the module docstring atsrc/agent_kernel/__init__.py:36-42:Implementation notes for AI
src/agent_kernel/__init__.pyonly.tests/test_public_api.pythat asserts every name in__all__also appears in the module docstring would prevent future drift.Acceptance criteria
__all__either appears in the docstring'sErrors::block or is intentionally omitted (with a comment explaining why).Duplicate check
Searched open issues for:
__all__,public API,docstring,TokenRevoked,HandleConstraintViolation.Result: no open duplicate.