feat(BA-6890): add kernel scheduling-history repository search scope#12868
Draft
jopemachine wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 15, 2026
Merged
jopemachine
force-pushed
the
feat/BA-6889-kernel-history-conditions-orders
branch
2 times, most recently
from
July 15, 2026 09:40
1d85def to
657f1a6
Compare
jopemachine
force-pushed
the
feat/BA-6890-kernel-history-repository-scope
branch
2 times, most recently
from
July 15, 2026 09:56
f9eff31 to
3cda92e
Compare
jopemachine
commented
Jul 15, 2026
| an empty scope would degenerate into an unscoped (admin) search. | ||
| """ | ||
|
|
||
| session_id: UUID | None = None |
jopemachine
commented
Jul 15, 2026
| session_id: UUID | None = None | ||
| """Restrict to the kernels of this session.""" | ||
|
|
||
| kernel_id: UUID | None = None |
Add KernelSchedulingHistorySearchScope and the scoped repository read path. Unlike the session/deployment/route scopes, which each carry one required entity id, a kernel query is scoped by session_id (all of a session's kernels), kernel_id, or both. to_condition() filters on each axis given and intersects when both are; existence_checks covers the corresponding session and kernel rows. At least one axis is required: an empty scope would silently degenerate into an unscoped, system-wide search, so it raises EmptyKernelSchedulingHistoryScope. The shared DTO validates this too (BA-6891); the scope defends it again because it is what the repository actually trusts. search_kernel_scoped_history mirrors the existing unscoped method, differing only in passing the scope to execute_batch_querier. The service actions that build this scope land in BA-6891. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jopemachine
force-pushed
the
feat/BA-6890-kernel-history-repository-scope
branch
from
July 15, 2026 10:17
3cda92e to
d384322
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 search ← you are hereBA-6891DTO + service: kernel v2 DTOs and search actionsBA-6892adapter + REST v2: kernel endpointsBA-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
KernelSchedulingHistorySearchScopeplus the scoped repository read path (search_kernel_scoped_historyon the repository and db_source).Why this scope is shaped differently
The session / deployment / route scopes each carry one required entity id. A kernel query is scoped by:
session_id— all of that session's kernels, orkernel_id— one kernel, orto_condition()filters on each axis given andANDs them;existence_checkscovers the correspondingSessionRow/KernelRow.At least one axis is required. An empty scope would silently degenerate into an unscoped, system-wide search — exactly what a scoped search exists to prevent — so it raises
EmptyKernelSchedulingHistoryScope. The shared DTO validates this too (#12869); the scope defends it again because the scope is what the repository actually trusts, and it is reachable from GraphQL (BA-6883) as well as REST.Review notes
search_kernel_scoped_historydiffers from the existing unscoped method by exactly one argument:scopes=[scope]onexecute_batch_querier.tests/AGENTS.mdnames "empty scope → error" as a canonical case to cover.The service actions that build this scope are #12869.
🤖 Generated with Claude Code