feat(BA-6882): expose kernel scheduling history via repository/service/adapter/REST v2/SDK/CLI#12860
Closed
jopemachine wants to merge 2 commits into
Closed
feat(BA-6882): expose kernel scheduling history via repository/service/adapter/REST v2/SDK/CLI#12860jopemachine wants to merge 2 commits into
jopemachine wants to merge 2 commits into
Conversation
…e/adapter/REST v2/SDK/CLI Expose kernel_scheduling_history end-to-end through the v2 backend, REST v2, SDK, and CLI, mirroring the existing session/deployment/route slices. GraphQL is out of scope and lands in BA-6883 on top of this adapter/service. The table, ORM row, domain data types, and an admin-only search_kernel_history repository method already existed; everything above the repository boundary was missing, and there was no scoped variant. Two deliberate deviations from the existing slices, both following the documented forward direction that those slices predate: - The scope is a request body field rather than a path param. A kernel query is scoped by session_id, kernel_id, or both, and an empty scope must be rejected, which a path param cannot express. Hence the fixed /kernels/scoped/search route and the scoped_ handler prefix. Non-emptiness is validated in the shared DTO model_validator and defended again in the repository scope. - The scoped route uses auth_required rather than superadmin_required, as a scoped search is for non-admins. The existing session/deployment/route scoped routes use superadmin_required, which is left alone here. KernelHistoryNode intentionally omits sub_steps: kernel_scheduling_history has no such column. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jopemachine
force-pushed
the
feat/BA-6882-kernel-scheduling-history-rest-cli
branch
from
July 15, 2026 03:17
f496a0a to
81f2442
Compare
Co-authored-by: octodog <mu001@lablup.com>
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.
Exposes
kernel_scheduling_historyend-to-end through the v2 backend + REST + SDK + CLI, mirroring the existing session/deployment/route slices. GraphQL is intentionally out of scope — BA-6883 adds it on top of the adapter/service built here.What was already there
The table, ORM row, domain data types, and an admin-only
search_kernel_historyrepository method already existed. Everything above the repository boundary was missing, and the repository had no scoped variant.Layers added
models/scheduling_history/conditions.pymodels/scheduling_history/orders.pyKERNEL_ORDER_FIELD_MAP, default/tiebreaker orders,resolve_kernel_ordercommon/data/permission/types.pyEntityType.KERNEL_HISTORY,KERNEL_SCOPED_HISTORYrepositories/scheduling_history/KernelSchedulingHistorySearchScope+search_kernel_scoped_history(repository + db_source)common/dto/manager/v2/scheduling_history/KernelHistoryFilter/Order/Node,KernelHistoryScopeDTO, admin + scoped inputs, payloadservices/scheduling_history/api/adapters/scheduling_history/adapter.pyadmin_search_kernel_history,kernel_scoped_search, querier/filter/order/DTO conversionapi/rest/v2/scheduling_history/POST /kernels/search,POST /kernels/scoped/searchclient/v2+client/cli/v2search_kernel_history/kernel_scoped_search,bai scheduling-history kernel search / search-scopedTwo deliberate deviations from the existing slices
Both follow the documented forward direction, which the existing session/deployment/route code predates.
1. The scope is a 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 (/v2/{entity}/scoped/search+ scope as a request body field), andclient/v2/AGENTS.mdnames the matchingscoped_search(request)SDK form. Hence the route/kernels/scoped/searchand thescoped_handler prefix.Non-emptiness is validated once, in the shared DTO
model_validator(KernelHistoryScopeDTO), and defended again in the repository scope.2. The scoped route uses
auth_required, notsuperadmin_required.api/rest/v2/AGENTS.mdstates that all scoped search routes useauth_required, and this story requires a non-admin scoped search. Note the existing session/deployment/route scoped routes are all registeredsuperadmin_required, which appears to defeat the purpose of a scoped search — left alone as out of scope here.The CLI follows from (1):
search-scopedtakes--session-id/--kernel-idrather than a positional ID, and errors cleanly when neither is given.Notes
sub_stepsis intentionally absent fromKernelHistoryNode:kernel_scheduling_historyhas no such column (the84b901f69d16migration added it to deployment/route only). BEP-1061 and BA-6852 both describe kernel as havingsub_steps— that discrepancy needs resolving on the writer side.conditions.py: this branch carries the samefrom_phase→from_statuscorrection, since it is the first caller of those factories. Whichever lands second needs a trivial conflict resolution.kernel_scheduling_historyhas no writer, so the table is empty; BA-6852 adds it. Every other acceptance criterion is met in code.🤖 Generated with Claude Code