public Map<String, List<Rule>> listRules(ResourceDescriptor resource) {
        if (!resource.isFolder() || !resource.isPublic()) {
            throw new IllegalArgumentException("Bad rule url: " + resource.getUrl());
        }

        Map<String, List<Rule>> rules = getCachedRules();
        Map<String, List<Rule>> result = new TreeMap<>();

        while (resource != null) {
            String url = ruleUrl(resource);
            List<Rule> list = rules.get(url);
            resource = resource.getParent();

            if (list != null) {
                result.put(url, list);
            }
        }

        return result;
    }
Key is updated time from the metadata. Value is decoded map (folder path, list of rules).
server/src/main/java/com/epam/aidial/core/server/service/RuleService.java