gemini/feature/multi-digest-architecture #61

Merged
eleith merged 18 commits from gemini/feature/multi-digest-architecture into main 2025-12-17 23:15:33 +00:00
18 Commits
Author SHA1 Message Date
eleith 8abbd67af4 remove PROJECT.md
ci/woodpecker/push/build-docker Pipeline was successful
2025-12-17 15:06:53 -08:00
eleith 8a98b82095 fix: improve config defaults and validation for robustness
- Set default Digest.View to 'date' if unspecified.
- Make Digest.View optional in validation.
- Enforce that Digest.Host and SMTP.Host are present if Digest.Email is configured.
- Update documentation to reflect these changes and correct required/optional statuses.
- Update tests to cover new defaults and validation rules.
2025-12-17 15:06:04 -08:00
eleith c51f66cc43 fix: restore default config values and update docs
- Restore logic to set default values for SMTP port (587) and Digest Compress (true) in config.
- Change Digest.Compress to *bool to correctly distinguish between unset and false values.
- Update CONFIG.md to reflect the removal of default categories in AI view.
- Fix logic that relied on defaults in processor and preview script.
2025-12-17 14:53:01 -08:00
eleith c04c352dfa fix: validate non-empty digest slugs and remove fallback
- Add validation in config.go to ensure digest titles produce non-empty slugs.
- Remove redundant fallback to 'default' slug in archive.go.
- Update tests to reflect these changes.
2025-12-17 14:41:03 -08:00
eleith 07870d00ee refactor: enforce strict user categories in AI view
- Remove default category injection in config to distinguish between explicit user categories and auto-mode.
- Update AI prompts:
    - Rename initialGroupingPrompt to openGroupingPrompt.
    - Add strictGroupingPrompt for enforcing user-defined categories.
- Update AI grouping logic:
    - Use strictGroupingPrompt and skip consolidation if categories are provided.
    - Use openGroupingPrompt and perform consolidation if categories are empty.
- Add Uncategorized group merging logic.
- Add tests for strict user mode and merging logic.
2025-12-17 14:16:15 -08:00
eleith 9220254157 update preview with miniflux to work with multiple digests 2025-12-17 08:16:00 -08:00
eleith 689c02a7dd merge uncategorized groups if exist 2025-12-17 08:15:47 -08:00
eleith f8a6902fdd generate urls for mock entries 2025-12-17 06:42:32 -08:00
eleith ed873f5d34 make config validation disallow extra fields, rename site url for filter 2025-12-17 05:51:03 -08:00
eleith cfd6921fe6 make host not required again 2025-12-17 05:20:33 -08:00
eleith 197f1698bd update preview to work with multiple digests 2025-12-17 05:20:23 -08:00
eleith 04ba0516a4 use any 2025-12-17 05:19:59 -08:00
eleith e2a105c0f5 remove uneeded comment 2025-12-16 11:49:25 -08:00
eleith 6bf421be87 docs: restructure configuration documentation
This commit improves the documentation strategy by separating the comprehensive reference manual from the example configuration file.

Changes:
- Created 'docs/CONFIG.md': A detailed guide to all configuration options, including the new multi-digest and filtering features, validation rules, and default AI categories.
- Updated 'config.yaml.example': Removed verbose comments to create a clean, copy-paste friendly template.
- Updated 'README.md': Added a prominent link to 'docs/CONFIG.md' in the Setup section.
2025-12-16 11:28:34 -08:00
eleith ef94db719d fix(config): enhance validation logic
This commit improves the configuration validation to prevent common user errors and runtime issues.

Changes:
- internal/config/config.go:
    - Added a check to ensure all digest titles result in unique slugs.
    - Added validation for all regex pattern fields in 'filters'.
    - Added 'validate:"dive"' to the 'Categories' field to ensure custom categories are validated.
- internal/config/config_test.go:
    - Added test cases for duplicate slugs, invalid regexes, and invalid categories.

This ensures that the application fails early with helpful errors if the configuration is invalid.
2025-12-16 11:15:48 -08:00
eleith c46f9b4f8b feat: implement Phase 5 (Output Structure)
Updates the archive generation to support the new folder structure: archives/<digest-slug>/<date>.html.

Changes:
- Updated 'OverviewTemplateData' to include 'DigestTitle' and 'DigestSlug'.
- Updated 'ArchiveService' to use 'DigestSlug' in file paths.
- Updated 'DigestService', 'View', and 'Processor' to propagate digest title/slug.
- Updated tests to match new structure and signatures.
2025-12-16 11:08:32 -08:00
eleith dd82382bed feat: implement Phases 2, 3, and 4 (Filter Engine, Processor Refactor, LLM Categories)
This commit delivers the core logic for the Multi-Digest Architecture.

Phase 2 (Filter Engine):
- Implemented 'internal/filter' with exact/prefix/regex matching.
- Implemented 'internal/manager' for digest priority assignment.
- Updated 'models.Entry' to include 'SiteURL'.

Phase 3 (Processor Refactor):
- Updated 'ProcessDigest' to filter entries using 'DigestManager'.
- Updated 'main.go' to schedule jobs per digest index.

Phase 4 (LLM & Categorization):
- Added 'DefaultCategories' in 'internal/config'.
- Updated LLM prompts and service flow to respect user-defined or default categories.
- Updated mocks and tests across the board.

The application now supports configuring multiple digests with distinct filters and categories, and correctly assigns entries and prompts the LLM accordingly.
2025-12-16 11:00:38 -08:00
eleith 61e57243e3 build: verify and fix Phase 1 configuration architecture
This commit stabilizes the 'Multi-Digest Architecture' feature (Phase 1).

Changes:
- Fix mocks in 'internal/app' and 'internal/testutil' to match new EmailService interface.
- Update 'ProcessDigest' calls in tests to respect new 'Digests' config slice.
- Update 'internal/config' tests to satisfy stricter validation rules (added missing 'host', 'view' fields).
- Verify 'Slugify' utility is present and tested.

Result:
- 'make lint', 'make test', and 'make build' now pass.
- The project is ready for Phase 2 (Filter Engine).
2025-12-16 09:25:05 -08:00