# E72 mission: repo_software

- mission: `msn-31a214cb1f`
- state: **COMPLETED** / COMPLETED
- execution class: REAL_LOCAL_ENGINEERING

**defect**: adaptive scheduling soft cap could floor to 0 and refuse all work (observed stall)

**limitations**: The pre-fix variant is reconstructed from the defect observed in the E72 scheduling run; it is not a pre-existing bug in HEAD and is not presented as one. Test execution is host-side; the workers independently recompute the scan, diff and hashes.

## Deliverable
```json
{
 "acceptance": true,
 "after_tail": "============================= test session starts ==============================\ncollected 11 items\n\ntests/test_e72_scheduling_regression.py ..                               [ 18%]\ntests/test_e68_workforce.py .........                                    [100%]\n\n======================== 11 passed in 100.05s (0:01:40) ========================\n",
 "before_tail": "========================= FAILURES ===================================\n_________________ test_soft_cap_one_never_produces_a_zero_cap __________________\ntests/test_e72_scheduling_regression.py:24: in test_soft_cap_one_never_produces_a_zero_cap\n    assert d[\"admit\"] is True, (v, d)\nE   AssertionError: (0.9999999999, {'admit': False, 'estimate': {'basis': 'conservative prior (no observations yet)', 'cpu_weight': 0.2, 'operation': 'count_words', 'predicted_s': 0.01, ...}, 'grants_authority': False, 'hard_cap': 8, ...})\nE   assert False is True\n=========================== short test summary info ============================\nFAILED tests/test_e72_scheduling_regression.py::test_soft_cap_one_never_produces_a_zero_cap\n========================= 1 failed, 1 passed in 0.75s ==========================\n",
 "defect": "adaptive scheduling soft cap could floor to 0 and refuse all work (observed stall)",
 "detected": true,
 "detector_findings": [
  {
   "line": 208,
   "match": "int(math.floor(self.soft_cap))",
   "pattern": "int\\(math\\.floor\\(self\\.soft_cap\\)\\)"
  },
  {
   "line": 140,
   "match": "max(1,",
   "pattern": "max\\(1,"
  },
  {
   "line": 142,
   "match": "max(1,",
   "pattern": "max\\(1,"
  },
  {
   "line": 142,
   "match": "max(1,",
   "pattern": "max\\(1,"
  },
  {
   "line": 143,
   "match": "max(1,",
   "pattern": "max\\(1,"
  },
  {
   "line": 209,
   "match": "max(1,",
   "pattern": "max\\(1,"
  },
  {
   "line": 248,
   "match": "max(1,",
   "pattern": "max\\(1,"
  }
 ],
 "diff_verified_by_worker": true,
 "evidence_of_original_failure": {
  "observed": "24 tasks, 0 verified, 187 SOFT_CAP refusals, mission RUNNING for 240 s",
  "run": "artifacts/e72/scheduling.json"
 },
 "execution_class": "REAL_LOCAL_ENGINEERING",
 "independent_test_scan": [
  {
   "line": 15,
   "match": "assert d[\"admit\"] is True",
   "pattern": "assert d\\[\\\"admit\\\"\\] is True"
  },
  {
   "line": 24,
   "match": "assert d[\"admit\"] is True",
   "pattern": "assert d\\[\\\"admit\\\"\\] is True"
  },
  {
   "line": 10,
   "match": "soft_cap",
   "pattern": "soft_cap"
  },
  {
   "line": 12,
   "match": "soft_cap",
   "pattern": "soft_cap"
  },
  {
   "line": 16,
   "match": "soft_cap",
   "pattern": "soft_cap"
  },
  {
   "line": 19,
   "match": "soft_cap",
   "pattern": "soft_cap"
  },
  {
   "line": 22,
   "match": "soft_cap",
   "pattern": "soft_cap"
  }
 ],
 "independent_verifier": {
  "buggy_failed": true,
  "patched_passed": true,
  "separate_worktree": "/tmp/opencode/e72-missions/repo-verify"
 },
 "limitations": "The pre-fix variant is reconstructed from the defect observed in the E72 scheduling run; it is not a pre-existing bug in HEAD and is not presented as one. Test execution is host-side; the workers independently recompute the scan, diff and hashes.",
 "mission": "repo_software",
 "patch_contains_fix": true,
 "patch_sha256": "d666fddea632fca25a72a44af0a819233c4ac82c2a1a6c29627e5caa5107387f",
 "repository": "/root/cain-studio-platform",
 "suite_after": "======================== 11 passed in 100.05s (0:01:40) ========================",
 "test_failed_before": true,
 "test_passed_after": true,
 "test_sha256": "b2c8451c15320594f5a05fbf098645e4a03edc7e8b780f46f3bf730aa68b3ec0"
}
```