Epic 4.4: Extract RecordingService from OpenSpace#33
Merged
Deepfreezechill merged 2 commits intomainfrom Apr 3, 2026
Merged
Conversation
New module: openspace/recording_service.py (66 lines) - RecordingService class: factory + wiring + cleanup for RecordingManager - create(): builds RecordingManager from config, registers to LLM - wire(): injects manager into GroundingClient - cleanup(): graceful stop with exception handling tool_layer.py: replaced 19 lines of inline recording setup/teardown with 7 lines delegating to RecordingService (-12 net lines) Tests: 14 new tests in test_recording_service.py - Init, create (enabled/disabled/config passthrough/LLM registration) - Wire (inject/noop), cleanup (active/inactive/no-manager/exception) - OpenSpace backward compatibility (both attrs present) All 1,356 existing tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Code fixes: - Null manager after cleanup() (prevents stale references, enables safe double-cleanup) - Re-raise CancelledError in cleanup() (proper async cancellation semantics) - Add debug log after successful recording stop (observability parity) - Move RecordingManager import to TYPE_CHECKING in tool_layer.py (dead runtime import) - Add asyncio import to recording_service.py for CancelledError Test improvements (14 → 17 tests): - C1: Assert logger.warning called on exception (not just 'no raise') - C2: create() twice replaces manager (idempotency coverage) - H1: cleanup() twice only stops once (double-cleanup safety) - H2: wire() before create() is safe noop - Strengthen noop assertions (verify manager is None, not just 'no raise') - Verify manager nulled after cleanup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔒 Phase Gate Enforcement — 🚫 FAIL
Verdict: FAIL
|
Deepfreezechill
pushed a commit
that referenced
this pull request
Apr 3, 2026
Restructure initialize() from 190-line monolith into clean orchestration: - initialize(): 70-line high-level flow with numbered steps - _load_grounding_config(): config loading, backend scope resolution - _setup_skill_engine(): skill registry, store, analyzer, evolver Cleanup: - Remove dead imports (asyncio, uuid — now in ExecutionEngine) - Remove stale extraction comments (4.1/4.3 notes) - Update from_container docstring (remove Phase 4 TODO — it's done) Public API unchanged. All 1,356 tests pass. P4 tool_layer.py decomposition summary (788 → 477 lines, -39%): - 4.1: ToolRegistry (206 lines, PR #31) - 4.3: ExecutionEngine (459 lines, PR #32) - 4.4: RecordingService (70 lines, PR #33) - 4.5: LLMFactory (68 lines, PR #34) - 4.6: Facade cleanup (this PR) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Deepfreezechill
added a commit
that referenced
this pull request
Apr 3, 2026
* feat(4.6): refactor OpenSpace into clean facade Restructure initialize() from 190-line monolith into clean orchestration: - initialize(): 70-line high-level flow with numbered steps - _load_grounding_config(): config loading, backend scope resolution - _setup_skill_engine(): skill registry, store, analyzer, evolver Cleanup: - Remove dead imports (asyncio, uuid — now in ExecutionEngine) - Remove stale extraction comments (4.1/4.3 notes) - Update from_container docstring (remove Phase 4 TODO — it's done) Public API unchanged. All 1,356 tests pass. P4 tool_layer.py decomposition summary (788 → 477 lines, -39%): - 4.1: ToolRegistry (206 lines, PR #31) - 4.3: ExecutionEngine (459 lines, PR #32) - 4.4: RecordingService (70 lines, PR #33) - 4.5: LLMFactory (68 lines, PR #34) - 4.6: Facade cleanup (this PR) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: remove unused Path import (review finding) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: remove stray main_tool_layer.py artifact Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Brian Krafft <bkrafft@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Summary
Extracts recording factory/wiring/cleanup from \OpenSpace.initialize()\ into a focused \RecordingService\ class.
What moved
Impact
ecording_service.py: 70 lines (new)
Review Protocol