Skip to content

feat(BA-6892): add kernel scheduling-history adapter and REST v2 endpoints#12870

Draft
jopemachine wants to merge 2 commits into
feat/BA-6891-kernel-history-dto-servicefrom
feat/BA-6892-kernel-history-adapter-rest
Draft

feat(BA-6892): add kernel scheduling-history adapter and REST v2 endpoints#12870
jopemachine wants to merge 2 commits into
feat/BA-6891-kernel-history-dto-servicefrom
feat/BA-6892-kernel-history-adapter-rest

Conversation

@jopemachine

@jopemachine jopemachine commented Jul 15, 2026

Copy link
Copy Markdown
Member

📚 Stacked PRs

Merge 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:

Route Auth
POST /v2/scheduling-history/kernels/search superadmin_required
POST /v2/scheduling-history/kernels/scoped/search auth_required

Two deliberate departures from the existing slices

Both follow the forward direction documented in api/rest/v2/AGENTS.md and client/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.md names this exact shape as the forward direction:

Forward direction: fixed path /v2/{entity}/scoped/search + scope as a request body field (not a path param). Consistent with SDK scoped_search and GQL scopedFoosV2.

Hence /kernels/scoped/search and the scoped_ handler prefix, rather than /kernels/{kernel_id}/search.

2. The scoped route uses auth_required, not superadmin_required. api/rest/v2/AGENTS.md states that all scoped search routes use auth_required, and BA-6882's acceptance criteria require a non-admin scoped search.

⚠️ Note the existing session / deployment / route scoped routes are all registered 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_filter is the bulk of the diff and mirrors _convert_session_filter axis for axis. Tests cover filter conversion per axis, OR conjunction 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/

jopemachine and others added 2 commits July 15, 2026 19:16
…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
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from e8ce7ad to b8a7aaa Compare July 15, 2026 10:17
@jopemachine
jopemachine force-pushed the feat/BA-6892-kernel-history-adapter-rest branch from 28b1894 to 3db2ec3 Compare July 15, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:manager Related to Manager component size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant