composer: add a stop condition to self.resolve_file()