code: def _process_rule(self, rule: dict, context: dict):
          
          if not rule or not self._shall_proceed(rule):
              return
          self.context.update(context)
          self.context.update(rule.get('context', {}))
          self.path = rule.get('path', None)
          self.source = rule.get('source', None)
          for entry in rule.get('documents', []):
              target, source = self._resolve_rule_document(entry)
              self.write(target, source)
          for entry in rule.get('preserve', []):
              target, source = self._resolve_rule_document(entry)
              self.write(target, source, preserve=True)
docs: process a single rule