Skip to content

Conversation

@cyrusagent
Copy link

@cyrusagent cyrusagent bot commented Oct 14, 2025

Summary

  • Implemented comprehensive application layer for Logjam's indexing and search functionality
  • Added DTOs for search requests and responses with filtering capabilities
  • Created use cases for indexing, search, URL queries, and link queries
  • Implemented repository trait for page persistence abstraction
  • Added comprehensive integration tests for all application layer functionality

Changes

Application Layer Structure

  • DTOs: Search request/response models with support for filtering by pages, URLs, and blocks
  • Use Cases:
    • IndexingUseCase: Handles crawling and indexing of pages with incremental updates
    • SearchUseCase: Performs full-text search across indexed content with filters
    • UrlQueriesUseCase: Retrieves pages and blocks by URL
    • LinkQueriesUseCase: Finds incoming/outgoing links and orphaned pages
  • Repository Trait: PageRepository interface for domain/infrastructure separation

Testing

  • Comprehensive integration tests with in-memory repository implementation
  • Tests cover indexing, search, URL queries, and link analysis
  • All tests passing with proper error handling validation

Test plan

  • Run cargo nextest run - all tests passing
  • Verify search functionality with filters
  • Test incremental indexing behavior
  • Validate link analysis and orphan detection

🤖 Generated with Claude Code

Cyrus AI and others added 2 commits October 14, 2025 04:01
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>
@weswalla weswalla merged commit 2389786 into main Oct 19, 2025
1 check 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