Skip to content

Feature smartcache#9

Merged
soumyaray merged 8 commits intomainfrom
feature-smartcache
Dec 24, 2025
Merged

Feature smartcache#9
soumyaray merged 8 commits intomainfrom
feature-smartcache

Conversation

@soumyaray
Copy link
Contributor

No description provided.

soumyaray and others added 8 commits December 23, 2025 19:29
- Move CLAUDE.md to .claude/ directory
- Update .gitignore to track .claude/ docs while ignoring local files
- Add feature planning doc for smart cache feature

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Answer all 6 open questions with analysis and rationale
- Document 5 key architectural decisions:
  1. Navigate cached tree for subfolder extraction
  2. Extraction logic in Representer (presentation layer)
  3. Roar deserialization is sufficient (OpenStruct tree)
  4. Cache invalidation strategy unchanged (TTL-based)
  5. Create Request::AppraisalRequest subsuming ProjectPath
- Define 6 implementation phases with detailed tasks
- Update session log with Phase 1 completion status

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Phase 2 of smart cache feature - consolidate request/job objects:

Request::Appraisal (replaces Request::ProjectPath):
- Parses route parameters (owner_name, project_name, folder_name)
- Owns cache_key generation (single source of truth)
- Adds root_request? helper for smart cache

Messaging::AppraisalJob (replaces Response::AppraisalRequest):
- DTO for worker queue payload
- Located in infrastructure/messaging with Queue
- Serialized via Representer::AppraisalJob

Cleanup:
- Delete legacy CloneRequest and AppraisalRequest (response/representer)
- Remove duplicate appraisal_cache_key helper from service
- Update worker JobReporter to use new naming

All 88 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- rake spec now runs only unit + integration tests (77 tests)
- rake spec:all runs all tests including acceptance (88 tests)
- bash spec/acceptance_tests starts worker and runs spec:all
- Internal test tasks hidden from rake -T

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add extract_subfolder(json, path) class method for cache extraction
- Add extract_subfolder_json(json, path) for JSON string output
- Handle edge cases: root path, nil, slashes, non-existent folders
- Add JSON fixtures in spec/fixtures/json/ (not wiped by vcr:wipe)
- Add 16 unit tests for extraction methods

Phase 3 of smart cache feature complete.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Request::Appraisal#cache_key always returns root key
- FetchOrRequestAppraisal always sends root folder_path to worker
- Worker remains general-purpose (appraises whatever it's told)
- API owns smart cache strategy; worker stays simple
- Updated unit tests for smart cache behavior

Phase 4 of smart cache feature complete.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ests

Phase 5-6 implementation:
- Refactor FetchOrRequestAppraisal with separate caching/extraction steps
- Add Representer::Appraisal.rebuild_with_extracted_folder for JSON reconstruction
- Add acceptance tests for smart cache behavior (subfolder extraction, 404 handling)
- Update CLAUDE.md documentation with smart cache architecture

Service step changes:
- check_cache → check_project_appraisal_cache
- New step: extract_folder_from_appraisal_on_cache_hit
- request_appraisal_worker → request_appraisal_worker_on_cache_miss

Key design: "folder not found" is a bad request (404), not a cache miss

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@soumyaray soumyaray merged commit 8752ff3 into main Dec 24, 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