{
  "familyId": "math.direct-proportion",
  "version": 1,
  "status": "draft",
  "name": "明示正比關係：代入與求比例常數",
  "scope": [
    "明示 y=k*x 的有理數代入",
    "明示正比且給一組非零 x 配對求 k；k 可为 0"
  ],
  "exclusions": [
    "反比",
    "非零截距",
    "從一組配對自行推定正比",
    "x=0,y=0 無法唯一求 k",
    "資料矛盾"
  ],
  "parameterSchema": {
    "mode": {
      "enum": [
        "substitute",
        "find-k"
      ]
    },
    "relation": {
      "const": "y=k*x"
    },
    "x": {
      "type": "rational-string"
    },
    "k": {
      "type": "rational-string",
      "requiredWhen": "substitute"
    },
    "y": {
      "type": "rational-string",
      "requiredWhen": "find-k"
    },
    "confirmed": {
      "const": true
    },
    "claimedAnswer": {
      "type": "rational-string",
      "optional": true
    }
  },
  "methods": [
    {
      "methodId": "direct-proportion.substitute",
      "version": 1,
      "applicability": "明示且確認 y=k*x，x與k皆為有效有理數",
      "steps": [
        {
          "id": "s1",
          "stage": 0,
          "title": "理解關係",
          "instruction": "確認要求的是 y，並找出 x、k。",
          "hint": "kx 是 k 與 x 相乘。",
          "check": "relation、x、k 來源已確認",
          "answerExposure": "none"
        },
        {
          "id": "s2",
          "stage": 1,
          "title": "固定方法",
          "instruction": "保留 y=k*x，將已知 x 寫入同一式。",
          "hint": "不要把 kx 誤讀成 k+x。",
          "check": "僅作數值代入，不更換关系",
          "answerExposure": "none"
        },
        {
          "id": "s3",
          "stage": 2,
          "title": "算出乘積",
          "instruction": "用精確分數乘法計算 k*x。",
          "hint": "整數可視為分母 1；先約分也可以。",
          "check": "獨立精確乘法與各步等式一致",
          "answerExposure": "partial"
        },
        {
          "id": "s4",
          "stage": 3,
          "title": "回代確認",
          "instruction": "把結果代回原式；請學生確認乘法關係。",
          "hint": "結果應等於原式右側。",
          "check": "回代一致；示範答案不記獨立掌握",
          "answerExposure": "final-after-confirmation"
        }
      ],
      "validatorRefs": [
        "facts.confirmed.v1",
        "relation.direct.v1",
        "rational.product.v1",
        "relation.back-substitution.v1",
        "claimed-answer.v1"
      ],
      "diagramRefs": [
        "direct-proportion.equal-groups",
        "direct-proportion.table"
      ]
    },
    {
      "methodId": "direct-proportion.find-k",
      "version": 1,
      "applicability": "明示且確認正比 y=k*x，給定 x、y；x 非零，先處理零值分支",
      "steps": [
        {
          "id": "s1",
          "stage": 0,
          "title": "確認正比",
          "instruction": "確認題目已明示正比與 x、y 配對。",
          "hint": "只給一組數字不能確定所有關係正比。",
          "check": "relation有明示證據、x y 已確認",
          "answerExposure": "none"
        },
        {
          "id": "s2",
          "stage": 1,
          "title": "選求 k 方法",
          "instruction": "x 非零時，等式兩邊同除以 x，得 k=y/x。",
          "hint": "先檢查 x 是否等於 0。",
          "check": "除數非零；零值分支不能略过",
          "answerExposure": "none"
        },
        {
          "id": "s3",
          "stage": 2,
          "title": "計算比例常數",
          "instruction": "精確計算 y/x 並約成最簡分數。",
          "hint": "y 可為 0；此時非零 x 得 k=0。",
          "check": "獨立除法與約分正確",
          "answerExposure": "partial"
        },
        {
          "id": "s4",
          "stage": 3,
          "title": "代回原式",
          "instruction": "檢查 k*x 是否等於已知 y。",
          "hint": "保留原配對，不另創條件。",
          "check": "原式回代一致",
          "answerExposure": "final-after-confirmation"
        }
      ],
      "validatorRefs": [
        "facts.confirmed.v1",
        "relation.direct.v1",
        "relation.zero-branch.v1",
        "rational.quotient.v1",
        "relation.back-substitution.v1",
        "claimed-answer.v1"
      ],
      "diagramRefs": [
        "direct-proportion.table"
      ]
    }
  ],
  "svgTemplateSpecs": [
    {
      "templateId": "direct-proportion.equal-groups",
      "version": 1,
      "parameters": [
        "x",
        "k",
        "verifiedTrace"
      ],
      "domainGuards": [
        "mode=substitute",
        "x,k 均非負整數",
        "群數及物件數各最多 12，總數最多 48，超過轉比例表",
        "必備事實已確認，trace 未被阻擋"
      ],
      "primitives": [
        "group",
        "circle",
        "text",
        "line"
      ],
      "revealSequence": [
        "標出每組 x",
        "逐組呈現 k 組",
        "學生確認後顯示總量 y"
      ],
      "fallback": "分數、負數、太多物件或 find-k 一律用比例表；k=0 顯示零組文字，不硬畫一組",
      "geometry": "illustrative, not to scale; 畫面文字：示意圖，非比例",
      "sourceBinding": "數量、標籤及答案只從同一 verifiedTrace 取值，不接受任意 SVG 片段"
    },
    {
      "templateId": "direct-proportion.table",
      "version": 1,
      "parameters": [
        "mode",
        "x",
        "k",
        "y",
        "verifiedTrace"
      ],
      "domainGuards": [
        "有理數有效且來源已確認",
        "find-k 零值分支未阻斷"
      ],
      "primitives": [
        "rect",
        "line",
        "text"
      ],
      "revealSequence": [
        "呈現關係與已知配對",
        "標示乘 k 或除 x 的合法轉換",
        "確認後揭露待求值"
      ],
      "fallback": "條件未確認只顯示已知值及待確認框，不顯示解答",
      "geometry": "資料表，不以格寬表示數值大小",
      "sourceBinding": "表格每格引用事實或 trace step；未知答案不得藏在 DOM"
    }
  ],
  "review": {
    "humanTeacherReviewed": false,
    "machineCheckStatus": "author-exact-arithmetic-checked; independent-main-validation-pending",
    "publicationEligibility": "draft-only",
    "source": "original-authored",
    "noStudentData": true
  },
  "validationPolicy": {
    "arithmetic": "exact rational; reduce by gcd; normalize denominator positive",
    "facts": "relation must be explicitly confirmed; a point is not proof of direct proportion",
    "zeroBranch": "find-k: x=0,y=0 -> confirm; x=0,y!=0 -> block",
    "backSubstitution": "substitute: y equals k*x; find-k: y equals computed k*x",
    "claimedAnswer": "if supplied and unequal to exact answer -> block; never replace silently",
    "release": "passes remain draft until teacher/content approval; not production verified"
  },
  "answerProjection": {
    "studentBeforeCompletion": "current prompt, confirmed facts and revealed diagram layers only",
    "private": "expected answers, held-out cases and validator traces"
  }
}
