You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fuse_adapter O5: resolve whitelist aliases and stop coercing counters #11
build_fuse_validated_inputs() always sets a canonical symbol_whitelist (default ["TQQQ", "SOXL", "BIL"]) and account_whitelist (default ["stage_n_shadow"]), even when the caller supplied only o5_symbol_whitelist / o5_account_whitelist. The vendored evaluate_O5() treats differing whitelist aliases as a violation.
As a result, an otherwise compliant TQQQ buy with o5_symbol_whitelist=["TQQQ", "SOXL"] is rejected. After three such sessions the account HALT latches.
Fix: when an alias is supplied, resolve the canonical value from it (or omit the canonical default), in the same way the O5 counters are handled (649007c, b0e285a).
2. session_order_count coercion turns invalid evidence into valid counts
int(raw_count) turns booleans (False becomes 0) and negative fractions (-0.5 becomes 0) into valid counters before O5 can validate them, so O5 passes where it should fail closed.
Fix: pass the supplied value through unchanged. Let the vendored _resolve_o5_alias validation reject non-integer, boolean or negative values.
Acceptance
A regression test for each case, reproducing the Codex examples.
The full suite and python -m shadow.sh2_acceptance stay green.
Adding the LOW findings from qsl-ai-reviewer on #9 @ 9137a64 (coverage complete, unresolved_findings false), per the SH-2 split policy:
fuse_adapter.build_fuse_validated_inputs(): tier=None or an unknown tier silently falls back to TIER_CONFIGS["balanced"] and tier_loss_budget_D = 0.30. Fail closed instead (None for tier_joint_cap and tier_loss_budget_D), and treat tier=None as invalid rather than as "None".
fuse_adapter._resolve_sizing_q_pre(): a non-integer Decimal (e.g. Decimal("10.5")) is truncated by int(). Reject it as None.
sizing.compute_session_sizing(): ln_one_minus_shock is still computed after Step 3 moved into compute_tier_max_loss_fraction(). Remove the unused local.
sizing.compute_session_sizing(): validate that tier_control_states is a Mapping with the expected tier keys before indexing, as is already done for fund_control_states.
tests/test_fuse_adapter.py: some tests assert directly on private helpers (_map_market_corporate_action, _apply_explicit_payload_tier, _finite_number, _map_calendar_statuses). Move them to public adapter entry points.
Activity
Pigbibi commentedon Nov 26, 2026
Adding the LOW findings from
qsl-ai-revieweron #9 @ 9137a64 (coverage complete, unresolved_findings false), per the SH-2 split policy:fuse_adapter.build_fuse_validated_inputs():tier=Noneor an unknown tier silently falls back toTIER_CONFIGS["balanced"]andtier_loss_budget_D = 0.30. Fail closed instead (Nonefortier_joint_capandtier_loss_budget_D), and treattier=Noneas invalid rather than as"None".fuse_adapter._resolve_sizing_q_pre(): a non-integerDecimal(e.g.Decimal("10.5")) is truncated byint(). Reject it asNone.sizing.compute_session_sizing():ln_one_minus_shockis still computed after Step 3 moved intocompute_tier_max_loss_fraction(). Remove the unused local.sizing.compute_session_sizing(): validate thattier_control_statesis aMappingwith the expected tier keys before indexing, as is already done forfund_control_states.tests/test_fuse_adapter.py: some tests assert directly on private helpers (_map_market_corporate_action,_apply_explicit_payload_tier,_finite_number,_map_calendar_statuses). Move them to public adapter entry points.Generated by Claude Code