{
  "system": "fscbac_matching_engine",
  "version": "3.1.0",
  "standard_level": "ULTRA_FORMAL",
  "canonical_source": true,
  "strict_mode": true,
  "integrity": "ABSOLUTE",

  "references": {
    "ages": "public/api/ages.json",
    "skills": "public/api/skills.json",
    "book_types": "public/api/book_types.json",
    "value_profile_taxonomy": "public/api/value_profile_taxonomy.json",
    "value_profile_rules": "public/api/value_profile_rules.json",
    "intents": "public/api/intents.json",
    "books": "public/api/books.json"
  },

  "age_skill_matrix": {
    "1-3": {
      "critical": ["confidence", "soft_story", "predictable_sequence", "sensory_safety"],
      "allowed": [
        "confidence", "soft_story", "predictable_sequence",
        "motor_basic", "attention_growth", "low_stimulation",
        "sensory_safety", "one_object_per_page", "low_cognitive_load"
      ],
      "forbidden": [
        "early_logic", "simple_dialogues", "imagination_seed", "logic",
        "concentration", "independent_thinking", "situational_language",
        "multi_scene_structure", "moral_reasoning", "structured_reasoning",
        "abstract_reasoning", "motor_mastery", "complex_shape_breakdown",
        "moderate_detail", "shape_variety", "thematic_exploration",
        "advanced_emotion_depth", "emotion_depth", "long_focus",
        "full_paragraph_bilingual", "parallel_reading", "meaning_alignment",
        "cross_language_mapping", "independent_language_growth"
      ]
    },

    "3-5": {
      "critical": ["imagination_seed", "early_logic", "simple_dialogues"],
      "allowed": [
        "imagination_seed", "early_logic", "simple_dialogues",
        "attention_growth", "speech_development", "moderate_detail",
        "shape_variety", "thematic_exploration", "low_cognitive_load",
        "predictable_parallel_lines", "bilingual_stories"
      ],
      "forbidden": [
        "structured_reasoning", "abstract_reasoning", "advanced_emotion_depth",
        "motor_mastery", "complex_shape_breakdown", "full_paragraph_bilingual",
        "parallel_reading", "meaning_alignment", "cross_language_mapping",
        "independent_language_growth"
      ]
    },

    "5-7": {
      "critical": ["logic", "concentration", "situational_language"],
      "allowed": [
        "emotion_depth", "logic", "concentration",
        "independent_thinking", "situational_language",
        "visual_planning", "moderate_detail", "creative_confidence"
      ],
      "forbidden": [
        "structured_reasoning", "abstract_reasoning", "moral_reasoning",
        "multi_scene_structure", "advanced_emotion_depth",
        "complex_shape_breakdown", "full_paragraph_bilingual",
        "parallel_reading", "meaning_alignment", "cross_language_mapping",
        "independent_language_growth"
      ]
    },

    "7-10": {
      "critical": ["structured_reasoning", "abstract_reasoning", "moral_reasoning"],
      "allowed": [
        "structured_reasoning", "abstract_reasoning", "moral_reasoning",
        "multi_scene_structure", "motor_mastery", "complex_shape_breakdown",
        "long_focus", "advanced_emotion_depth", "full_paragraph_bilingual",
        "parallel_reading", "meaning_alignment", "cross_language_mapping",
        "independent_language_growth", "creative_confidence"
      ],
      "forbidden": ["soft_story", "one_object_per_page", "predictable_sequence"]
    }
  },

  "age_booktype_matrix": {
    "1-3": {
      "optimal": ["bedtime_story", "simple_coloring", "bilingual_intro"],
      "secondary": ["coloring"],
      "forbidden": ["bilingual_extended", "step_by_step_drawing"]
    },
    "3-5": {
      "optimal": ["bedtime_story", "coloring", "bilingual_story"],
      "secondary": ["simple_coloring"],
      "forbidden": ["bilingual_extended", "step_by_step_drawing"]
    },
    "5-7": {
      "optimal": ["bedtime_story", "coloring_detailed", "bilingual_story"],
      "secondary": [],
      "forbidden": ["simple_coloring"]
    },
    "7-10": {
      "optimal": ["bedtime_story", "step_by_step_drawing", "bilingual_extended"],
      "secondary": [],
      "forbidden": []
    }
  },

  "forbidden_logic": [
    { "id": "F1", "match": { "emotional_intensity": "high", "age_in": ["1-3", "3-5"] }, "result": "EXCLUDED" },
    { "id": "F2", "match": { "visual_load": "high_detail", "age_in": ["1-3"] }, "result": "EXCLUDED" },
    { "id": "F3", "match": { "narrative_structure": "multi_scene_complex", "age_in": ["1-3", "3-5"] }, "result": "EXCLUDED" }
  ],

  "value_profile_check": [
    { "attribute": "complexity", "allowed": "value_profile_rules[age].complexity", "penalty": -1.0 },
    { "attribute": "emotional_intensity", "allowed": "value_profile_rules[age].emotional_intensity", "penalty": -1.0 },
    { "attribute": "narrative_structure", "allowed": "value_profile_rules[age].narrative_structure", "penalty": -1.0 },
    { "attribute": "linguistic_load", "allowed": "value_profile_rules[age].linguistic_load", "penalty": -1.0 },
    { "attribute": "visual_load", "allowed": "value_profile_rules[age].visual_load", "penalty": -1.0 }
  ],

  "weights": {
    "skills": { "critical": 1.0, "allowed": 0.6, "forbidden": -1.0 },
    "book_types": { "optimal": 1.0, "secondary": 0.6, "forbidden": -1.0 },
    "value_profile": { "full": 1.0, "compatible": 0.7, "partial": 0.4, "incompatible": -1.0 }
  },

  "formula": {
    "F": {
      "weights": { "skills": 0.45, "value_profile": 0.33, "book_types": 0.22 }
    }
  },

  "ranking": {
    "IDEAL": { "range": ["F >= 0.85"] },
    "STRONG": { "range": ["0.65 <= F < 0.85"] },
    "ACCEPTABLE": { "range": ["0.35 <= F < 0.65"] },
    "EXCLUDED": { "range": ["F < 0.35"] }
  },

  "safety": {
    "rules": [
      { "id": "S1", "match": { "emotional_intensity": "high", "age_in": ["1-5"] }, "result": "FORBIDDEN" },
      { "id": "S2", "match": { "visual_load": "high_detail", "age_in": ["1-3"] }, "result": "FORBIDDEN" },
      { "id": "S3", "match": { "narrative_structure": "multi_scene_complex", "age_in": ["1-5"] }, "result": "FORBIDDEN" },
      { "id": "S4", "match": { "missing_attributes": true }, "result": "UNSAFE" }
    ]
  },

  "ai_contract": {
    "rules": [
      "CHECK_FORBIDDEN_FIRST",
      "APPLY_WEIGHTS_EXACT",
      "NO_AGE_MIXING",
      "PRIORITIZE_SAFETY",
      "ORIGIN_IS_NOT_SCORED"
    ]
  },

  "meta": {
    "deterministic": true,
    "machine_interpretable": true,
    "canonical": true,
    "version_stamp": "3.1.0_FINAL"
  }
}
