Skip to content

feat(BA-6581): wire IdleCheckerRepository into idle-check reconciler source#12398

Open
seedspirit wants to merge 3 commits into
mainfrom
feat/BA-6581
Open

feat(BA-6581): wire IdleCheckerRepository into idle-check reconciler source#12398
seedspirit wants to merge 3 commits into
mainfrom
feat/BA-6581

Conversation

@seedspirit

Copy link
Copy Markdown
Contributor

Summary

  • Add IdleCheckerRepository (with its DB source and result types) that fetches a normalized IdleCheckSnapshot of sessions, their applicable scopes, scope→checker bindings, and typed checker specs.
  • Wire the repository through the orchestration DI (composer/sokovan input) and the reconciler stage factory so IdleCheckSource fetches real data instead of returning a placeholder.
  • Make IdleCheckerSpecABC.load dispatch by checker_type to concrete SessionLifetimeSpec / NetworkTimeoutSpec / UtilizationSpec specs (fields land with the checker-logic stories).
  • Add ScopeType, ScopeRef, and IdleCheckSessionView data types.

Test plan

  • pants test on changed targets (test_source, test_stage, test_sokovan, test_composer) — passing locally via pre-push hook
  • CI green

Resolves BA-6581

…source

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the size:L 100~500 LoC label Jun 24, 2026
@github-actions github-actions Bot added the comp:manager Related to Manager component label Jun 24, 2026
seedspirit and others added 2 commits June 24, 2026 18:08
…tainer

Construct it in an IdleCheckerRepositories container and pass it through
OrchestrationInput like the other repositories, instead of building it
inline in the orchestration composer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@seedspirit seedspirit marked this pull request as ready for review June 24, 2026 09:37
@seedspirit seedspirit requested a review from a team as a code owner June 24, 2026 09:37
Copilot AI review requested due to automatic review settings June 24, 2026 09:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the placeholder idle-check reconciler source with a real data path. It introduces an IdleCheckerRepository (backed by a new IdleCheckerDBSource) that fetches a normalized IdleCheckSnapshot — sessions, their applicable scopes (resource group / project / domain), scope→checker bindings, and typed checker specs — and wires this repository through the orchestration DI and the reconciler stage factory so IdleCheckSource.fetch_reconcile_info returns the snapshot instead of an empty placeholder. It also makes IdleCheckerSpecABC.load dispatch by checker_type into concrete (currently field-less) spec classes that land their fields in follow-up stories. The change is read-only; the handler/applier remain placeholders.

Changes:

  • New idle_checker repository layer (repository, repositories, db_source, result types) producing IdleCheckSnapshot, plus new ScopeType/ScopeRef/IdleCheckSessionView data types.
  • DI wiring of idle_checker_repository through Repositories, both orchestration composers, sokovan input, and the reconciler stage factory, with IdleCheckReconcileInfo switched from session_ids to snapshot.
  • IdleCheckerSpecABC.load now dispatches on checker_type to SessionLifetimeSpec / NetworkTimeoutSpec / UtilizationSpec.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
repositories/idle_checker/db_source/db_source.py New DB reads assembling the normalized snapshot (joins + correlated enabled-binding filter).
repositories/idle_checker/repository.py Thin repository delegating to the db_source.
repositories/idle_checker/repositories.py IdleCheckerRepositories container following the per-entity wrapper convention.
repositories/idle_checker/types.py IdleCheckerRef, IdleCheckerBindingRef, IdleCheckSnapshot result types.
repositories/repositories.py Registers idle_checker in the aggregate Repositories.
data/idle_checker/types.py Adds ScopeType, ScopeRef, IdleCheckSessionView.
models/idle_checker/spec.py load discriminated dispatch + concrete spec subclasses.
sokovan/idle_check/source.py Injects repository; fetches real snapshot.
sokovan/idle_check/types.py IdleCheckReconcileInfo carries snapshot; entity_ids derives from it.
sokovan/stages/idle_check.py build_idle_check_stage now takes the repository.
sokovan/stages/factory.py Threads idle_checker_repository into stage assembly.
dependencies/orchestration/composer.py, dependencies/orchestration/sokovan.py, dependencies/composer.py DI plumbing of the new repository.
tests/.../idle_check/test_source.py, test_stage.py, dependencies/orchestration/test_sokovan.py, test_composer.py Update/add tests for the new repository argument and source behavior.
changes/12398.feature.md Changelog entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to +34
async def fetch_idle_check_snapshot(
self, session_statuses: Collection[SessionStatus]
) -> IdleCheckSnapshot:
"""Fetch sessions and scope-bound idle checkers without expanding to session-checker rows."""
@seedspirit seedspirit marked this pull request as draft June 24, 2026 10:14
@seedspirit seedspirit marked this pull request as ready for review June 25, 2026 01:54
@seedspirit seedspirit requested a review from HyeockJinKim June 25, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants