Skip to content

refactor: phases 3-5 architectural refactoring (#84)#87

Merged
maxine-at-forecast merged 2 commits intodevelopfrom
feature/M2KE-2Jps-phases-3-5-of-gh-84-architectural-refactoring-work
Apr 1, 2026
Merged

refactor: phases 3-5 architectural refactoring (#84)#87
maxine-at-forecast merged 2 commits intodevelopfrom
feature/M2KE-2Jps-phases-3-5-of-gh-84-architectural-refactoring-work

Conversation

@maxine-at-forecast
Copy link
Copy Markdown
Contributor

Summary

Implements Phases 3-5 of the architectural refactoring plan from #84:

Phase 3 — Internal Delegation + AppView + Temporal Coupling:

  • Move insert_dataset/write_samples logic from Index to Repository, making Index methods thin dispatchers
  • Extract with_appview_fallback() helper to atmosphere/_appview.py, narrowing except Exception to specific httpx/AppView errors
  • Switch _AtmosphereBackend to eager initialization, removing temporal coupling from _ensure_loaders()

Phase 4 — Provider Fixes:

  • Fix Redis label resolution with created_at timestamp ordering (old labels without it sort last)
  • Fix Redis N+1 query in iter_entries using pipeline batch fetch
  • Add SQLite indexes for schema (name, version) and labels (name, created_at DESC)

Phase 5 — Atmosphere Namespacing + Cleanup:

  • Add RecordOps, BlobOps, XrpcClient namespace classes on Atmosphere (exposed as .records, .blobs, .xrpc lazy properties)
  • Switch all 18 DeprecationWarning sites to FutureWarning (visible by default in user code)
  • Fix thread-safety of _atproto_client_class with double-checked locking via threading.Lock
  • Split StubManager into SchemaStubManager/LensStubManager with shared _StubWriter base class

Test plan

  • All 1735 tests pass (176 skipped, 22 warnings)
  • ruff check src/ clean
  • CI passes on this branch

🤖 Generated with Claude Code

maxine-at-forecast and others added 2 commits April 1, 2026 15:12
Phase 3 — Internal delegation + AppView + temporal coupling:
- Move insert_dataset/write_samples logic from Index to Repository
- Extract with_appview_fallback() helper to atmosphere/_appview.py
- Switch _AtmosphereBackend to eager init, remove _ensure_loaders()

Phase 4 — Provider fixes:
- Fix Redis label resolution with created_at timestamp ordering
- Fix Redis N+1 query in iter_entries using pipeline batch fetch
- Add SQLite indexes for schema (name,version) and labels (name,created_at)

Phase 5 — Atmosphere namespacing + cleanup:
- Add RecordOps, BlobOps, XrpcClient namespace classes on Atmosphere
- Switch all 18 DeprecationWarning sites to FutureWarning (visible by default)
- Fix thread-safety of _atproto_client_class with double-checked locking
- Split StubManager into SchemaStubManager/LensStubManager with _StubWriter base

All 1735 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 83.01887% with 45 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/atdata/atmosphere/client.py 57.14% 24 Missing ⚠️
src/atdata/repository.py 83.05% 10 Missing ⚠️
src/atdata/_stub_manager.py 89.41% 9 Missing ⚠️
src/atdata/__init__.py 0.00% 1 Missing ⚠️
src/atdata/index/_index.py 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@maxine-at-forecast maxine-at-forecast marked this pull request as ready for review April 1, 2026 22:24
@maxine-at-forecast maxine-at-forecast self-assigned this Apr 1, 2026
@maxine-at-forecast maxine-at-forecast merged commit 366191b into develop Apr 1, 2026
7 of 8 checks passed
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