Enhance chunking system with WP-24c v4.2.6 and v4.2.7 updates: Introduce is_meta_content flag for callouts in RawBlock, ensuring they are chunked but later removed for clean context. Update parse_blocks and propagate_section_edges to handle callout edges with explicit provenance for chunk attribution. Implement clean-context logic to remove callout syntax post-processing, maintaining chunk integrity. Adjust get_chunk_config to prioritize frontmatter overrides for chunking profiles. Update documentation to reflect these changes.

This commit is contained in:
Lars committed 2026-01-11 11:14:31 +01:00
1 parent 4d43cc526e
commit 55b64c331a
8 files changed
+231 -43

No files matched your search

+22 -3
View File
@@ -27,12 +27,31 @@ def load_yaml_config() -> Dict[str, Any]:
return data
except Exception: return {}
def get_chunk_config(note_type: str) -> Dict[str, Any]:
"""Lädt die Chunking-Strategie basierend auf dem Note-Type."""
def get_chunk_config(note_type: str, frontmatter: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
"""
Lädt die Chunking-Strategie basierend auf dem Note-Type.
WP-24c v4.2.5: Frontmatter-Override für chunking_profile hat höchste Priorität.
Args:
note_type: Der Typ der Note (z.B. "decision", "experience")
frontmatter: Optionales Frontmatter-Dict mit chunking_profile Override
Returns:
Dict mit Chunking-Konfiguration
"""
full_config = load_yaml_config()
profiles = full_config.get("chunking_profiles", {})
type_def = full_config.get("types", {}).get(note_type.lower(), {})
profile_name = type_def.get("chunking_profile") or full_config.get("defaults", {}).get("chunking_profile", "sliding_standard")
# WP-24c v4.2.5: Priorität: Frontmatter > Type-Def > Defaults
profile_name = None
if frontmatter and "chunking_profile" in frontmatter:
profile_name = frontmatter.get("chunking_profile")
if not profile_name:
profile_name = type_def.get("chunking_profile")
if not profile_name:
profile_name = full_config.get("defaults", {}).get("chunking_profile", "sliding_standard")
config = profiles.get(profile_name, DEFAULT_PROFILE).copy()
if "overlap" in config and isinstance(config["overlap"], list):
config["overlap"] = tuple(config["overlap"])