# Task 20 Step 17: calibration gate applied to results/calibration.json (2026-09-14)
# Code run (Step 17's inline script, adapted to the gate API: evaluateCalibration(report) with the default CALIBRATION_PROTOCOL;
# `selected` is a grid.full record, not `.params`):
#   node --input-type=module -e "import { readFileSync } from 'node:fs'; import { evaluateCalibration } from './tools/calibrationGate.mjs';
#     const v = evaluateCalibration(JSON.parse(readFileSync('results/calibration.json','utf8')));
#     console.log(JSON.stringify({ ok: v.ok, mustStop: v.mustStop, stage: v.stage, failed: v.failed, candidateCount: v.candidateCount,
#       selected: v.selected, tally: v.tally, error: v.error, problems: v.problems }, null, 2)); console.log(v.message);
#     process.exitCode = v.ok ? 0 : 1;"

{
  "ok": false,
  "mustStop": true,
  "stage": "grid",
  "failed": [
    "B2a"
  ],
  "candidateCount": 0,
  "selected": null,
  "tally": {
    "B1": {
      "evaluated": 180,
      "failed": 0
    },
    "B2a": {
      "evaluated": 180,
      "failed": 180
    },
    "B2b": {
      "evaluated": 0,
      "failed": 0
    },
    "B2c": {
      "evaluated": 0,
      "failed": 0
    },
    "B2d": {
      "evaluated": 0,
      "failed": 0
    },
    "B2e": {
      "evaluated": 0,
      "failed": 0
    }
  },
  "error": false,
  "problems": []
}
B1 與 B2 在 180 個網格點中都無法同時通過（每個檢查的失敗次數：{"B1":0,"B2a":180,"B2b":0,"B2c":0,"B2d":0,"B2e":0}；篩選階段沒跑到的檢查不計）。停止，並回報使用者。規格 §13 禁止為了讓模型通過而調整迴路選取、可塑性參數、回饋類型或世界參數；規格 §14 規定查證結果推翻設計時必須先回報，不得自行更改設計。
exit=1
