infra: catch protection in the recovery ladder is 2 hours, not 6 (operator decision)
This commit is contained in:
parent
e35858e96e
commit
18bef06cef
3 changed files with 7 additions and 7 deletions
|
|
@ -33,7 +33,7 @@ HOLD = 3 * 3600 # restart-only spacing while the reset budget is spent
|
||||||
DAY = 24 * 3600
|
DAY = 24 * 3600
|
||||||
MAX_RESETS = 2 # milestone resets per DAY
|
MAX_RESETS = 2 # milestone resets per DAY
|
||||||
AGAIN = 12 * 3600 # after this long the last reset's archive may be restored again (row 70)
|
AGAIN = 12 * 3600 # after this long the last reset's archive may be restored again (row 70)
|
||||||
PROTECT = 6 * 3600 # a species owned this recently is not reset away (row 70)
|
PROTECT = 2 * 3600 # a species owned this recently is not reset away (row 70)
|
||||||
VETO_LIMIT = 3 # model vetoes of one step before it goes ahead anyway
|
VETO_LIMIT = 3 # model vetoes of one step before it goes ahead anyway
|
||||||
MODEL_BUDGET = 90 # seconds across all models in one decision
|
MODEL_BUDGET = 90 # seconds across all models in one decision
|
||||||
VERIFY_TIMEOUT = 240
|
VERIFY_TIMEOUT = 240
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ a ladder one step per trap that outlives the previous step:
|
||||||
a new rung, a species owned for the first time, a map entered for the first time, or a trainer
|
a new rung, a species owned for the first time, a map entered for the first time, or a trainer
|
||||||
or badge beaten. The run pays each of these once, so a ring cannot earn them twice. A trap that
|
or badge beaten. The run pays each of these once, so a ring cannot earn them twice. A trap that
|
||||||
follows real progress is a new trap, and it starts again from a restart.
|
follows real progress is a new trap, and it starts again from a restart.
|
||||||
- **Protected catches:** a milestone reset never erases a species owned in the last six hours
|
- **Protected catches:** a milestone reset never erases a species owned in the last two hours
|
||||||
(`PROTECT`, from `window.progress.species`). Within that window the step is a restart, spaced by
|
(`PROTECT`, from `window.progress.species`). Within that window the step is a restart, spaced by
|
||||||
the hold like a spent budget, and `history.jsonl` records a `protect` event. A reset turned into a
|
the hold like a spent budget, and `history.jsonl` records a `protect` event. A reset turned into a
|
||||||
restart this way does not climb the ladder: the level keeps its slot and the reset comes, at the
|
restart this way does not climb the ladder: the level keeps its slot and the reset comes, at the
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ class RecoveryTests(unittest.TestCase):
|
||||||
self.assertEqual(self.acts, [("reset", 11)])
|
self.assertEqual(self.acts, [("reset", 11)])
|
||||||
|
|
||||||
def test_a_species_owned_recently_is_never_reset_away(self):
|
def test_a_species_owned_recently_is_never_reset_away(self):
|
||||||
owned = T0 - recover.HOLD - 600
|
owned = T0 - 1200
|
||||||
recover.write_json(recover.STATE, {"level": 2, "bestRank": 12, "resets": [],
|
recover.write_json(recover.STATE, {"level": 2, "bestRank": 12, "resets": [],
|
||||||
"actedAt": T0 - recover.HOLD - 300, "speciesAt": owned})
|
"actedAt": T0 - recover.HOLD - 300, "speciesAt": owned})
|
||||||
self.assertIn("flysim restarted", self.confirm(T0))
|
self.assertIn("flysim restarted", self.confirm(T0))
|
||||||
|
|
@ -411,9 +411,9 @@ class ClosedLoopTests(unittest.TestCase):
|
||||||
self.assertTrue(len(resets) >= 3, acts)
|
self.assertTrue(len(resets) >= 3, acts)
|
||||||
gaps = [b[0] - a[0] for a, b in zip(resets, resets[1:])]
|
gaps = [b[0] - a[0] for a, b in zip(resets, resets[1:])]
|
||||||
self.assertTrue(all(g <= 25 for g in gaps), acts)
|
self.assertTrue(all(g <= 25 for g in gaps), acts)
|
||||||
# the first step is a restart; the catch stays protected for 6 h
|
# the first step is a restart; the catch stays protected for 2 h
|
||||||
self.assertEqual(acts[0][1], "restart")
|
self.assertEqual(acts[0][1], "restart")
|
||||||
self.assertTrue(all(a[0] >= 6 - 0.2 for a in resets[:1]), acts)
|
self.assertTrue(all(a[0] >= 2 - 0.2 for a in resets[:1]), acts)
|
||||||
|
|
||||||
def test_the_held_reset_is_the_rung_12_one_not_a_deeper_rung(self):
|
def test_the_held_reset_is_the_rung_12_one_not_a_deeper_rung(self):
|
||||||
acts = self.simulate({11: self.R11, 12: self.R12, 10: self.R10, 9: self.R10}, 24, species_before=6)
|
acts = self.simulate({11: self.R11, 12: self.R12, 10: self.R10, 9: self.R10}, 24, species_before=6)
|
||||||
|
|
@ -423,7 +423,7 @@ class ClosedLoopTests(unittest.TestCase):
|
||||||
clean = dict(self.R12, trap=None)
|
clean = dict(self.R12, trap=None)
|
||||||
acts = self.simulate({11: self.R11, 12: clean, 10: self.R10, 9: self.R10}, 24, species_before=6)
|
acts = self.simulate({11: self.R11, 12: clean, 10: self.R10, 9: self.R10}, 24, species_before=6)
|
||||||
self.assertEqual([a[1:] for a in acts if a[1] == "reset"], [("reset", 12)], acts)
|
self.assertEqual([a[1:] for a in acts if a[1] == "reset"], [("reset", 12)], acts)
|
||||||
self.assertEqual(len(acts), 3, acts)
|
self.assertEqual(len(acts), 2, acts)
|
||||||
|
|
||||||
def test_without_a_catch_the_ladder_resets_early(self):
|
def test_without_a_catch_the_ladder_resets_early(self):
|
||||||
acts = self.simulate({11: self.R11, 12: self.R12, 10: self.R10, 9: self.R10}, 24)
|
acts = self.simulate({11: self.R11, 12: self.R12, 10: self.R10, 9: self.R10}, 24)
|
||||||
|
|
@ -437,7 +437,7 @@ class ClosedLoopTests(unittest.TestCase):
|
||||||
acts = self.simulate({11: clean11, 12: late12, 10: self.R10, 9: self.R10}, 96)
|
acts = self.simulate({11: clean11, 12: late12, 10: self.R10, 9: self.R10}, 96)
|
||||||
resets = [a for a in acts if a[1] == "reset"]
|
resets = [a for a in acts if a[1] == "reset"]
|
||||||
self.assertEqual([a[2] for a in resets], [12, 11], acts)
|
self.assertEqual([a[2] for a in resets], [12, 11], acts)
|
||||||
self.assertLessEqual(resets[-1][0], 8, acts)
|
self.assertLessEqual(resets[-1][0], 7, acts) # 6.83 h with the 2 h protection (was 2.08 h in v0.7.0)
|
||||||
self.assertLess([a[2] for a in resets].count(12), 2, acts)
|
self.assertLess([a[2] for a in resets].count(12), 2, acts)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue