OSSS.ai.store.frontmatter¶
OSSS.ai.store.frontmatter
¶
Enhanced frontmatter schema for OSSS notes.
This module provides comprehensive frontmatter structures for rich metadata including topics, agent status tracking, domain classification, and more.
AgentStatus
¶
Bases: Enum
Status values for individual agent processing.
DifficultyLevel
¶
Bases: Enum
Difficulty levels for content classification.
AgentConfidenceLevel
¶
Bases: Enum
Confidence levels for agent outputs.
AgentExecutionResult
¶
Bases: BaseModel
Detailed execution result for a single agent.
model_post_init(__context)
¶
Auto-calculate confidence level from numeric confidence.
WorkflowExecutionMetadata
¶
Bases: BaseModel
Comprehensive workflow execution metadata for execution provenance.
Provides complete audit trail, performance analytics, and reproducibility information for enterprise and scientific use cases.
create_config_fingerprint(workflow_config, prompt_config)
classmethod
¶
Create a SHA256 fingerprint from workflow and prompt configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow_config
|
Dict[str, Any]
|
Workflow definition dictionary |
required |
prompt_config
|
Dict[str, Any]
|
Prompt composition configuration |
required |
Returns:
| Type | Description |
|---|---|
str
|
SHA256 hash string for configuration fingerprinting |
calculate_cost_estimate(tokens_used, model)
¶
Calculate cost estimate based on token usage and model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tokens_used
|
int
|
Total tokens consumed |
required |
model
|
str
|
LLM model name |
required |
Returns:
| Type | Description |
|---|---|
float
|
Estimated cost in USD |
EnhancedFrontmatter
¶
Bases: BaseModel
Enhanced frontmatter schema for OSSS notes.
Provides comprehensive metadata including topics, agent status tracking, domain classification, and relationship mapping.
add_agent_result(agent_name, result)
¶
Add or update an agent execution result.
add_topic(topic)
¶
Add a topic if not already present.
add_related_query(query)
¶
Add a related query if not already present.
update_last_modified()
¶
Update the last_updated timestamp.
calculate_reading_time(text_content)
¶
Calculate and set reading time based on word count.
TopicTaxonomy
¶
create_basic_frontmatter(title, agent_outputs, timestamp=None, filename=None)
¶
Create basic frontmatter for backward compatibility.
This provides a migration path from the old simple frontmatter to the new enhanced schema.
agent_outputs supports both strings and structured dicts for backward compatibility.
frontmatter_to_yaml_dict(frontmatter)
¶
Convert EnhancedFrontmatter to a YAML-serializable dictionary.
This handles enum conversion and nested structures for YAML export.