Probably functional. Testing

This commit is contained in:
Test User
2025-10-23 19:29:26 +02:00
parent ab4b95c664
commit 245530389d
17 changed files with 657 additions and 108 deletions
+18 -5
View File
@@ -1,6 +1,7 @@
"""
Main frontmatter processor
"""
import sys
from pathlib import Path
from datetime import datetime
from core.database import Database
@@ -10,6 +11,7 @@ from core.rules import RulesEngine
from core.template import TemplateManager
from core.llm import LLMClient
from core.changelog import ChangeLog
from core.config import ConfigManager
class FrontmatterProcessor:
@@ -22,15 +24,26 @@ class FrontmatterProcessor:
self.force = force
self.add_only = add_only
# Initialize configuration
self.config = ConfigManager()
self.config.ensure_config_exists()
# Get API configuration
api_config = self.config.get_api_config()
self.db = Database(repo.path / 'madomeda.db')
self.rules = RulesEngine(repo.path / 'rules')
self.templates = TemplateManager(repo.path / 'templates')
self.llm = LLMClient(repo.path / 'prompts')
self.rules = RulesEngine(self.config.rules_dir)
self.templates = TemplateManager(self.config.templates_dir)
self.llm = LLMClient(self.config.prompts_dir, api_config)
self.changelog = ChangeLog(repo.path)
self.parser = FrontmatterParser()
def process(self):
"""Main processing loop"""
# Print configuration info if running in interactive shell
if sys.stdin.isatty():
self.config.print_config_info()
print(f"Processing repository: {self.repo.path}")
print(f"Template: {self.template_name}")
print(f"Mode: {'DRY RUN' if self.whatif else 'LIVE'}")
@@ -235,8 +248,8 @@ class FrontmatterProcessor:
elif field == 'tags':
tags = normalized_fm.get('tags', [])
# Always return the list (even if empty) so it's preserved
return tags
# Return None if empty so AI inference is tried
return tags if tags else None
return None