C-001 임상 검토 게이트 보강
This commit is contained in:
parent
391fb9f4d0
commit
6988280b30
18 changed files with 1896 additions and 67 deletions
|
|
@ -68,6 +68,85 @@ class ResistanceEngineTest(unittest.TestCase):
|
|||
self.assertTrue(all(state.rapport_credit == 0 for state in advice_curve))
|
||||
self.assertGreaterEqual(advice_curve[-1].resistance, 0.95)
|
||||
|
||||
def test_evolve_clamps_existing_ideation_state_over_cap(self) -> None:
|
||||
state = state_machine.SessionState(ideation_stage=5)
|
||||
|
||||
self.assertEqual(state.ideation_stage, state_machine.IDEATION_STAGE_CAP)
|
||||
# 이전 버전에서 만들어진 비정상 객체가 메모리에 남은 상황도 전이 경계에서
|
||||
# 다시 정규화되는지 확인한다.
|
||||
state.ideation_stage = 5
|
||||
|
||||
evolved = state_machine.evolve(
|
||||
state,
|
||||
rapport_signal=0.0,
|
||||
unlock_rate=P1.unlock_rate(),
|
||||
decay_floor=P1.decay_floor(),
|
||||
)
|
||||
|
||||
self.assertEqual(evolved.ideation_stage, state_machine.IDEATION_STAGE_CAP)
|
||||
self.assertEqual(evolved.snapshot()["ideation_stage"], state_machine.IDEATION_STAGE_CAP)
|
||||
|
||||
def test_evolve_clamps_observed_ideation_over_cap(self) -> None:
|
||||
state = state_machine.SessionState(ideation_stage=1)
|
||||
|
||||
evolved = state_machine.evolve(
|
||||
state,
|
||||
rapport_signal=0.0,
|
||||
unlock_rate=P1.unlock_rate(),
|
||||
decay_floor=P1.decay_floor(),
|
||||
ideation_observed=5,
|
||||
)
|
||||
|
||||
self.assertEqual(evolved.ideation_stage, state_machine.IDEATION_STAGE_CAP)
|
||||
|
||||
def test_init_state_clamps_baseline_and_carry_over_cap(self) -> None:
|
||||
baseline_over_cap = state_machine.init_state(
|
||||
params=state_machine.OpennessParams(
|
||||
base_resistance=0.65,
|
||||
unlock_rate=0.25,
|
||||
decay_floor=0.2,
|
||||
ideation_baseline=5,
|
||||
)
|
||||
)
|
||||
carry_over_cap = state_machine.init_state(
|
||||
params=P1.openness_params(),
|
||||
carry={"ideation_stage": 5},
|
||||
)
|
||||
|
||||
self.assertEqual(baseline_over_cap.ideation_stage, state_machine.IDEATION_STAGE_CAP)
|
||||
self.assertEqual(carry_over_cap.ideation_stage, state_machine.IDEATION_STAGE_CAP)
|
||||
|
||||
def test_valid_ideation_values_preserve_monotonic_behavior(self) -> None:
|
||||
state = state_machine.SessionState(ideation_stage=2)
|
||||
|
||||
raised = state_machine.evolve(
|
||||
state,
|
||||
rapport_signal=0.0,
|
||||
unlock_rate=P1.unlock_rate(),
|
||||
decay_floor=P1.decay_floor(),
|
||||
ideation_observed=3,
|
||||
)
|
||||
unchanged = state_machine.evolve(
|
||||
state,
|
||||
rapport_signal=0.0,
|
||||
unlock_rate=P1.unlock_rate(),
|
||||
decay_floor=P1.decay_floor(),
|
||||
ideation_observed=1,
|
||||
)
|
||||
initialized = state_machine.init_state(
|
||||
params=state_machine.OpennessParams(
|
||||
base_resistance=0.65,
|
||||
unlock_rate=0.25,
|
||||
decay_floor=0.2,
|
||||
ideation_baseline=2,
|
||||
),
|
||||
carry={"ideation_stage": 1},
|
||||
)
|
||||
|
||||
self.assertEqual(raised.ideation_stage, 3)
|
||||
self.assertEqual(unchanged.ideation_stage, 2)
|
||||
self.assertEqual(initialized.ideation_stage, 2)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue