{
  "contract_id": "workers-clamp-teaching-v1",
  "status": "Newly authored fictional exercise contract; not inferred customer/product policy.",
  "unit": "worker-count integer; one case invocation is one exported function call with one requested int.",
  "input_domain": {
    "precondition": "type(requested) is int; excludes bool even though bool is an int subclass in Python.",
    "valid_values": "All Python integers, including negatives. This declares behavior; finite tests do not prove it for all integers.",
    "negative_input_policy": "Allowed input; return1. This is a new explicit teaching rule. Historical article did not establish this policy.",
    "outside_domain": "Unspecified/unperformed. No adapter/type validator is implemented or claimed; bool,float,string,None,parsing/normalization/overflow behavior is not accepted."
  },
  "written_requirement": [
    {
      "id": "W1",
      "when": "requested is less than1",
      "required_result": 1
    },
    {
      "id": "W2",
      "when": "requested is between1and20 inclusive",
      "required_result": "the requested integer unchanged"
    },
    {
      "id": "W3",
      "when": "requested is greater than20",
      "required_result": 20
    }
  ],
  "state_policy": "Pure helper with no retained state, network or service calls; each test calls exact exported function.",
  "test_plan": {
    "existing_three": "Inputs1,10,30; literal values1,10,20 in new harness. Preserves original input inventory without reusing its arithmetic expected-expression.",
    "original_zero": "requested0 must produce1, central historical/fresh counterexample.",
    "six_neighbors": "Just below/at/just above lower bound1:0,1,2. Just below/at/just above upper bound20:19,20,21. Both output bounds inclusive.",
    "selected_nine": "-1,0,1,2,10,19,20,21,30; includes six neighbors, the new negative policy, nominal10 and retained far-upper30. Overlapping memberships do not add distinct cases.",
    "held_out_seven": "Requested7/expected7 intentionally excluded from selected-nine and used to challenge a deliberately seeded interior-hole variant. Designed experiment, not statistically independent validation.",
    "weak_assertion": "0<=actual<=20 deliberately permits the forbidden0 and ignores exact preservation for in-range inputs. Passing this gate is not contract satisfaction."
  },
  "implementations": {
    "upper-only": "Historical min(requested,20) body; missing lower clamp.",
    "corrected": "Actual candidate max(1,min(requested,20)), independently observed against literal expectations.",
    "constant-one": "Deliberately wrong output-range-compliant constant1; challenges non-vacuity/in-range preservation.",
    "cap-nineteen": "Deliberately wrong upper limit19; challenges upper-edge sensitivity.",
    "interior-hole": "Deliberately seeded requested7->8, otherwise corrected calculation. Passing selected-nine is expected, then designed held-out7 exposes it."
  },
  "closure_policy": "Original input fixed is an instance observation. Selected-nine passes are bounded requirement checks. No finite set here establishes all inputs, class closure, statistical confidence or a formal proof.",
  "exclusions": [
    "No product/customer/production defect or incident is represented.",
    "No authenticated original2October runtime or raw log is available; only retained article attribution and exact snippet.",
    "No parser/type validation,boolean,float,string,fixed-width overflow,resource/scheduler/concurrency behavior is tested. Python int arithmetic is arbitrary precision, not a machine-width overflow test.",
    "No exhaustive input enumeration,formal proof,randomized property campaign,measured mutation score or automatic equivalence-class closure.",
    "No collection,empty/singleton,duration/size/adaptor example is executed by this kit; such examples must remain illustrative if article uses them.",
    "No Proof CLI,service,solver,CI merge policy or repository protection is executed by this standard-library fixture."
  ]
}
