Conversation
This commit implements the application layer (PER-3), building on the domain layer from PER-1. It provides use cases for indexing, search, and querying page/URL relationships. ## Application Layer Components ### Repository Traits - `PageRepository`: Interface for page persistence operations (save, find, delete) ### Use Cases - `SearchPagesAndBlocks`: Search across pages/blocks/URLs with filtering - Traditional keyword-based search - Semantic search placeholder (for future implementation) - Filter by result type (pages, blocks, URLs, or all) - Filter by specific pages - Returns results with hierarchical context - `IndexPage` & `BatchIndexPages`: Index pages for search - Save pages to repository - Support single and batch operations - `GetPagesForUrl`: Find all pages containing a specific URL - Returns page connections with block references - `GetLinksForPage`: Get all URLs in a page with context - Returns URLs with hierarchy paths - Includes related page references from ancestors/descendants ### DTOs - `SearchRequest`: Search query parameters - `SearchResult`, `SearchItem`: Search results with context - `PageResult`, `BlockResult`, `UrlResult`: Typed search results - `PageConnection`, `UrlWithContext`: Query result types ## Testing - Unit tests for all use cases with in-memory repository - Comprehensive integration test suite (10 tests) demonstrating: - Keyword search across knowledge base - Result type filtering - Page filtering - URL-to-pages connections - Page-to-links queries - Hierarchical context preservation - Cross-page reference discovery All 94 tests passing (50 application + 32 domain + 10 integration + 2 existing integration tests). ## Architecture The application layer follows clean architecture principles: - No infrastructure dependencies - Uses repository interfaces (implementations in future PR) - Orchestrates domain logic - Transforms domain entities to DTOs for external consumption 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The workflow was failing because cargo-nextest was cached in ~/.cargo/bin but the install step didn't check if it already existed. Now we check the version first, and only install if the command doesn't exist. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.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
Changes
Application Layer Structure
IndexingUseCase: Handles crawling and indexing of pages with incremental updatesSearchUseCase: Performs full-text search across indexed content with filtersUrlQueriesUseCase: Retrieves pages and blocks by URLLinkQueriesUseCase: Finds incoming/outgoing links and orphaned pagesPageRepositoryinterface for domain/infrastructure separationTesting
Test plan
cargo nextest run- all tests passing🤖 Generated with Claude Code