The Depart­ment of Home­land Secu­rity will miss an ini­tial dead­line of July 12 to comply with a sweeping fed­eral law meant to thwart ter­rorist attacks arriving by sea, frus­trating border secu­rity advo­cates who worry that the agency has not done enough to pre­vent dan­gerous cargo from coming through the country’s ocean gate­ways, including the Port of Boston.