feat(BA-6892): add kernel scheduling-history adapter and REST v2 endpoints#12870
Draft
jopemachine wants to merge 2 commits into
Draft
feat(BA-6892): add kernel scheduling-history adapter and REST v2 endpoints#12870jopemachine wants to merge 2 commits into
jopemachine wants to merge 2 commits into
Conversation
This was referenced Jul 15, 2026
Merged
jopemachine
force-pushed
the
feat/BA-6891-kernel-history-dto-service
branch
from
July 15, 2026 09:40
db1b59b to
6d7ebbc
Compare
jopemachine
force-pushed
the
feat/BA-6892-kernel-history-adapter-rest
branch
from
July 15, 2026 09:40
b9b9a37 to
8c13791
Compare
jopemachine
force-pushed
the
feat/BA-6891-kernel-history-dto-service
branch
from
July 15, 2026 09:56
6d7ebbc to
e8ce7ad
Compare
jopemachine
force-pushed
the
feat/BA-6892-kernel-history-adapter-rest
branch
from
July 15, 2026 09:56
8c13791 to
28b1894
Compare
…oints
Add the adapter and the two REST v2 endpoints for kernel scheduling history.
Two deliberate departures from the existing session/deployment/route slices,
both following the forward direction documented in api/rest/v2/AGENTS.md and
client/v2/AGENTS.md, which those slices predate:
- The scope is carried in the request body, not the path. A kernel query is
scoped by session_id, kernel_id, or both, and an empty scope must be
rejected, none of which a path param can express. Hence the fixed
POST /kernels/scoped/search route and the scoped_ handler prefix, rather
than /kernels/{kernel_id}/search.
- The scoped route uses auth_required, not superadmin_required, because a
scoped search exists precisely so non-admins can query within a scope. The
existing scoped routes are all registered superadmin_required, which appears
to defeat that purpose; left alone as out of scope here.
Tests cover filter conversion per axis, OR conjunction, order direction, and
data-to-DTO conversion including null statuses.
The SDK and CLI that call these endpoints land in BA-6893.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: octodog <mu001@lablup.com>
jopemachine
force-pushed
the
feat/BA-6891-kernel-history-dto-service
branch
from
July 15, 2026 10:17
e8ce7ad to
b8a7aaa
Compare
jopemachine
force-pushed
the
feat/BA-6892-kernel-history-adapter-rest
branch
from
July 15, 2026 10:17
28b1894 to
3db2ec3
Compare
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 PRs
BA-6887fix: kernel history conditions reference the real status columnsBA-6889models: kernel query conditions and ordersBA-6890repository: kernel search scope and scoped searchBA-6891DTO + service: kernel v2 DTOs and search actionsBA-6892adapter + REST v2: kernel endpoints ← you are hereBA-6893SDK + CLI: kernel commandsMerge in order, bottom-up. Each PR is based on the one above it, so its diff shows only its own layer.
What
The adapter and the two REST v2 endpoints:
POST /v2/scheduling-history/kernels/searchsuperadmin_requiredPOST /v2/scheduling-history/kernels/scoped/searchauth_requiredTwo deliberate departures from the existing slices
Both follow the forward direction documented in
api/rest/v2/AGENTS.mdandclient/v2/AGENTS.md, which the session / deployment / route slices predate.1. The scope is a request body field, not a path param. A kernel query is scoped by
session_id,kernel_id, or both, and an empty scope must be rejected — none of which a path param can express.api/rest/v2/AGENTS.mdnames this exact shape as the forward direction:Hence
/kernels/scoped/searchand thescoped_handler prefix, rather than/kernels/{kernel_id}/search.2. The scoped route uses
auth_required, notsuperadmin_required.api/rest/v2/AGENTS.mdstates that all scoped search routes useauth_required, and BA-6882's acceptance criteria require a non-admin scoped search.superadmin_required, which appears to defeat the purpose of a scoped search (a superadmin needs no scope). That looks like a bug in those routes, but changing them is out of scope here — flagging it for a separate decision.Review notes
_convert_kernel_filteris the bulk of the diff and mirrors_convert_session_filteraxis for axis. Tests cover filter conversion per axis,ORconjunction collapsing to one condition, order direction, and data→DTO conversion including null statuses.The SDK and CLI that call these endpoints are #12866.
🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--12870.org.readthedocs.build/en/12870/
📚 Documentation preview 📚: https://sorna-ko--12870.org.readthedocs.build/ko/12870/