feat: implement SHA-256-based artifact storage system#63
Merged
Conversation
- Add storeArtifact() function for content-addressed storage - Implement resolveArtifactPath() helper for artifact path resolution - Create .ragtech/artifacts/ directory structure with automatic creation - Support both string and Buffer input types with deterministic hashing - Prevent duplicate writes by checking existing artifacts - Add comprehensive unit tests covering all functionality - Ensure content integrity with SHA-256 hash verification This provides the foundational artifact storage needed for future DAG and reproducibility work, with stable API exposure for pipeline integration.
…iew-pr pattern detection Pattern: Runtime directory not added to .gitignore Observed in: refactor/s1-artifacts
- Move integration tests from scripts/__tests__/ to tests/integration/ per project convention - Add .ragtech/ to .gitignore to prevent committing runtime artifacts - Use full 64-character SHA-256 hash instead of 12-char truncated version - Add optional ext parameter for file extensions (.mp4, .txt, etc.) - Add optional baseDir parameter to avoid process.cwd() coupling - Update tests to use temp directory isolation with fs.mkdtempSync() - Enhance test coverage to 12 tests including extension handling scenarios This resolves all blockers and warnings from the code review while maintaining backward compatibility with existing API calls.
- Add extension normalization to handle both '.txt' and 'txt' formats - Add leading-dot guard to prevent silent API footguns in extension parameter - Document deduplication behavior: keyed on (content, ext) not content alone - Update JSDoc to clarify extension parameter requirements - Add comprehensive test coverage for extension normalization scenarios - Enhance integration tests to verify path resolution with normalized extensions This improves API robustness while maintaining backward compatibility and providing clear documentation of deduplication behavior patterns.
Member
Author
Note: 4 failing suites (generate-carousel, CaptionExtractor, transcript-caption, CarouselGenerator) are failing due to predated test suites relating to Carousel. Creating issue to recommend if removing or updating test files are appropriate. |
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
.ragtech/artifacts/How to review
Test plan
npm test -- scripts/__tests__/artifacts.test.tspasses (8/8 tests)npx tsx -e "import './scripts/config/artifacts.ts'"loads without errorsnpx tsx -e "import { storeArtifact } from './scripts/config/artifacts.ts'; console.log(storeArtifact('test'))"returns hashIssues
Closes #11