add an assert to test a code assumption
change assert to a warning
move a helper function for unit invisibility to display_context