Spaces:
Sleeping
Sleeping
| from __future__ import annotations | |
| STAGE_SEQUENCE: list[tuple[str, str]] = [ | |
| ("setup_inputs", "Setup & Inputs"), | |
| ("source_extraction_objective_mapping", "Source Extraction / Objective Mapping"), | |
| ("slide_outline_order", "Slide Outline & Order"), | |
| ("title_generation", "Title Generation"), | |
| ("text_generation", "Text Generation"), | |
| ("image_visual_asset_generation", "Image / Visual Asset Generation"), | |
| ("aesthetic_ordering_visual_composition", "Aesthetic Ordering / Visual Composition"), | |
| ("technical_review", "Technical Review"), | |
| ("pedagogical_review", "Pedagogical Review"), | |
| ("aesthetic_review", "Aesthetic Review"), | |
| ("final_render_export", "Final Render & Export"), | |
| ("audit_log_version_history", "Audit Log / Version History"), | |
| ] | |
| STAGE_IDS = [stage_id for stage_id, _label in STAGE_SEQUENCE] | |
| STAGE_LABELS = dict(STAGE_SEQUENCE) | |
| APPROVAL_REQUIRED_STAGE_IDS = STAGE_IDS[:10] | |
| STAGE_RUBRICS: dict[str, list[tuple[str, str, float]]] = { | |
| "setup_inputs": [ | |
| ("required_inputs_present", "Required inputs present", 1.4), | |
| ("url_validity", "URL validity", 1.0), | |
| ("render_mode_safety", "Render mode safety", 1.0), | |
| ], | |
| "source_extraction_objective_mapping": [ | |
| ("source_extraction_completeness", "Source extraction completeness", 1.0), | |
| ("objective_clarity", "Objective clarity", 1.1), | |
| ("objective_uniqueness", "Objective uniqueness", 0.8), | |
| ], | |
| "slide_outline_order": [ | |
| ("objective_coverage", "Objective coverage", 1.4), | |
| ("logical_flow", "Logical flow", 1.0), | |
| ("appropriate_slide_count", "Appropriate slide count", 0.8), | |
| ("no_major_redundancy", "No major redundancy", 0.8), | |
| ], | |
| "title_generation": [ | |
| ("title_clarity", "Title clarity", 1.1), | |
| ("title_specificity", "Title specificity", 1.0), | |
| ("objective_alignment", "Objective alignment", 1.2), | |
| ], | |
| "text_generation": [ | |
| ("clarity", "Clarity", 1.0), | |
| ("text_density", "Text density", 1.3), | |
| ("source_grounding", "Source grounding", 1.3), | |
| ("speaker_notes_quality", "Speaker notes quality", 1.0), | |
| ], | |
| "image_visual_asset_generation": [ | |
| ("visual_relevance", "Visual relevance", 1.0), | |
| ("asset_completeness", "Asset completeness", 1.3), | |
| ("alt_text_presence", "Alt text presence", 1.1), | |
| ("license_or_generation_metadata", "License or generation metadata", 1.0), | |
| ], | |
| "aesthetic_ordering_visual_composition": [ | |
| ("layout_schema_validity", "Layout schema validity", 1.4), | |
| ("slot_compliance", "Slot compliance", 1.1), | |
| ("visual_hierarchy", "Visual hierarchy", 0.8), | |
| ("readability", "Readability", 1.0), | |
| ], | |
| "technical_review": [ | |
| ("technical_accuracy", "Technical accuracy", 1.3), | |
| ("unsupported_claim_detection", "Unsupported claim detection", 1.5), | |
| ("terminology_consistency", "Terminology consistency", 0.8), | |
| ], | |
| "pedagogical_review": [ | |
| ("objective_coverage", "Objective coverage", 1.4), | |
| ("learning_progression", "Learning progression", 1.0), | |
| ("examples_or_applications", "Examples or applications", 0.8), | |
| ("speaker_notes_teachability", "Speaker notes teachability", 1.1), | |
| ], | |
| "aesthetic_review": [ | |
| ("layout_consistency", "Layout consistency", 1.1), | |
| ("readability", "Readability", 1.0), | |
| ("accessibility", "Accessibility", 1.3), | |
| ("brand_template_compliance", "Brand/template compliance", 1.0), | |
| ], | |
| "final_render_export": [ | |
| ("preflight_passed", "Preflight passed", 1.6), | |
| ("all_required_approvals_valid", "All required approvals valid", 1.2), | |
| ("no_stale_stages", "No stale stages", 1.1), | |
| ("export_target_safety", "Export target safety", 1.0), | |
| ], | |
| "audit_log_version_history": [ | |
| ("audit_events_present", "Audit events present", 1.0), | |
| ("artifact_versions_traceable", "Artifact versions traceable", 1.2), | |
| ("review_notes_traceable", "Reviewer notes traceable", 0.8), | |
| ], | |
| } | |
| TEXT_DENSITY_LIMITS: dict[str, dict[str, int]] = { | |
| "intro": {"max_visible_words": 35, "max_bullets": 0}, | |
| "motivation": {"max_visible_words": 55, "max_bullets": 3}, | |
| "concept": {"max_visible_words": 65, "max_bullets": 4}, | |
| "worked_example": {"max_visible_words": 90, "max_bullets": 5}, | |
| "procedure": {"max_visible_words": 90, "max_bullets": 6}, | |
| "comparison": {"max_visible_words": 85, "max_bullets": 5}, | |
| "common_misconception": {"max_visible_words": 75, "max_bullets": 4}, | |
| "knowledge_check": {"max_visible_words": 100, "max_bullets": 6}, | |
| "demo_setup": {"max_visible_words": 80, "max_bullets": 5}, | |
| "demo_walkthrough": {"max_visible_words": 90, "max_bullets": 6}, | |
| "summary": {"max_visible_words": 70, "max_bullets": 5}, | |
| "transition": {"max_visible_words": 25, "max_bullets": 0}, | |
| "unknown": {"max_visible_words": 65, "max_bullets": 4}, | |
| } | |
| INSTRUCTIONAL_ROLES = { | |
| "concept", | |
| "worked_example", | |
| "procedure", | |
| "comparison", | |
| "common_misconception", | |
| "knowledge_check", | |
| "demo_setup", | |
| "demo_walkthrough", | |
| "summary", | |
| } | |
| APPROVED_LAYOUTS: dict[str, dict[str, object]] = { | |
| "title_only": { | |
| "required_slots": {"title"}, | |
| "optional_slots": set(), | |
| "slot_word_limits": {"title": 14}, | |
| }, | |
| "title_body": { | |
| "required_slots": {"title", "body"}, | |
| "optional_slots": {"subtitle"}, | |
| "slot_word_limits": {"title": 14, "body": 80, "subtitle": 24}, | |
| }, | |
| "title_bullets_visual": { | |
| "required_slots": {"title", "bullets", "visual"}, | |
| "optional_slots": {"caption"}, | |
| "slot_word_limits": {"title": 14, "bullets": 90, "visual": 8, "caption": 18}, | |
| }, | |
| "worked_example": { | |
| "required_slots": {"title", "problem", "steps"}, | |
| "optional_slots": {"visual", "answer"}, | |
| "slot_word_limits": {"title": 14, "problem": 45, "steps": 100, "visual": 8, "answer": 30}, | |
| }, | |
| "knowledge_check": { | |
| "required_slots": {"title", "question", "options"}, | |
| "optional_slots": {"answer"}, | |
| "slot_word_limits": {"title": 14, "question": 55, "options": 70, "answer": 28}, | |
| }, | |
| } | |
| RAW_COORDINATE_KEYS = {"x", "y", "width", "height", "left", "top", "w", "h"} | |