Skip to content

Implementation Plan: Replace vestigial OSError guard with Protocol dispatch#3989

Merged
Trecek merged 3 commits into
developfrom
t4-p3-a10-wp1-replace-vestigial-oserror-guard-with-protocol/3930
Jun 10, 2026
Merged

Implementation Plan: Replace vestigial OSError guard with Protocol dispatch#3989
Trecek merged 3 commits into
developfrom
t4-p3-a10-wp1-replace-vestigial-oserror-guard-with-protocol/3930

Conversation

@Trecek

@Trecek Trecek commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace cli/app.py's direct call to claude_code_project_dir() (wrapped in a dead except OSError guard) with Protocol-dispatched ctx.backend.session_locator().project_log_dir(). Remove the now-unused claude_code_project_dir import. Add a smoke test proving the activity check lambda receives the backend-derived marker directory.

Requirements


plan_id: a83ae274-34af-4772-a500-f9ac02160ced
source_commit: 8136d95

Goal

Replace vestigial OSError guard with Protocol dispatch and prove routing via smoke test.

Context

  • Phase: SessionLocator Protocol Fixes and Call-Site Migration (Milestone: 3-sessionlocator-protocol-fixes-and-call-site-migration)
  • Assignment: P3-A10 (Migrate cli/app.py:157 to Protocol-dispatched project_log_dir)
  • Depends on: P3-A3-WP1
  • Depended on by: P3-A13-WP1

Deliverables

  • app.py — OSError guard removed, Protocol dispatch added, import removed
  • test_app_main.py — smoke test asserting activity_check uses backend-derived marker_dir

Technical Steps

  1. Remove claude_code_project_dir from autoskillit.core import block.
  2. Replace lines 155-159 with: _marker_dir = ctx.backend.session_locator().project_log_dir(...) if ctx.backend is not None else None
  3. Verify _marker_dir: Path | None annotation preserved.
  4. Verify is_server_active() already guards None marker_dir.
  5. Add @pytest.mark.medium smoke test that monkeypatches make_context, anyio.run, and serve_with_signal_guard.

Acceptance Criteria

  • claude_code_project_dir not in app.py.
  • No try/except OSError at former call site.
  • RecipeSource and atomic_write still imported.
  • _marker_dir: Path | None annotation preserved.
  • Smoke test passes with mock backend.
  • task test-check passes.

Closes #3930

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260610-100822-985723/.autoskillit/temp/make-plan/t4-p3-a10-wp1-replace-vestigial-oserror-guard_plan_2026-06-10_101500.md

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
plan* opus[1m] 1 2.1k 16.8k 698.6k 79.2k 29 60.8k 6m 52s
verify* sonnet 1 52 15.3k 229.9k 58.6k 18 37.7k 5m 43s
implement* MiniMax-M3 1 1.1M 5.4k 0 0 49 0 4m 13s
fix* sonnet 1 134 8.8k 798.9k 67.1k 44 46.1k 4m 6s
audit_impl* sonnet 1 44 4.7k 165.5k 40.7k 11 23.6k 2m 33s
prepare_pr* MiniMax-M3 2 420.9k 5.3k 0 0 28 0 2m 6s
compose_pr* MiniMax-M3 1 213.8k 1.5k 0 0 14 0 42s
review_pr* sonnet 1 132 19.2k 790.4k 65.1k 44 45.0k 4m 25s
resolve_review* sonnet 1 245 21.4k 2.1M 92.7k 69 72.6k 9m 23s
Total 1.8M 98.5k 4.8M 92.7k 285.9k 40m 7s

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
plan 0
verify 0
implement 75 0.0 0.0 72.4
fix 8 99862.4 5768.4 1098.8
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 8 262663.4 9071.0 2680.4
Total 91 52577.6 3141.6 1082.3

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 2.1k 16.8k 698.6k 60.8k 6m 52s
sonnet 5 607 69.4k 4.1M 225.1k 26m 13s
MiniMax-M3 3 1.8M 12.2k 0 0 7m 2s

Trecek and others added 3 commits June 10, 2026 10:26
…ionLocator Protocol

Replace the vestigial try/except OSError guard around direct
claude_code_project_dir() call with Protocol-dispatched
ctx.backend.session_locator().project_log_dir(). The Protocol dispatch
is backend-agnostic — ClaudeSessionLocator delegates to the same
function, but other backends (e.g. Codex) can now return their own
project log dir without cli/app.py needing to know.

Also remove the now-unused claude_code_project_dir import and add a
smoke test in tests/cli/test_app_main.py proving the activity_check
lambda receives the backend-derived marker_dir. Test file size
marker upgraded from small to medium (uses asyncio.run to exercise
the async closure path).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
autoskillit.cli.__init__ exports `app` (the App instance), so
monkeypatch.setattr("autoskillit.cli.app.*") traverses to the App
object rather than the module. Use importlib.import_module to obtain
the module directly, matching the pattern already used in the sibling test.
…rd assertion

Per reviewer findings L47 and L91:
- Move asyncio and MagicMock imports from inside test function body to module
  level; remove redundant local `import importlib` (already at module level)
- Strengthen `assert captured_activity_check` to `assert len(...) == 1` so the
  test catches regressions where serve_with_signal_guard is called multiple times

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Trecek Trecek added this pull request to the merge queue Jun 10, 2026
Merged via the queue into develop with commit eff81f0 Jun 10, 2026
3 checks passed
@Trecek Trecek deleted the t4-p3-a10-wp1-replace-vestigial-oserror-guard-with-protocol/3930 branch June 10, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant