feat(diagrams): add findLatestContentHashForAppRoute with app-route cache
Agent-scoped lookups miss diagrams from routes whose publishing agents have been redeployed or removed. The new method resolves by (applicationId, environment, routeId) + created_at DESC, independent of the agent registry. An in-memory cache mirrors the existing hashCache pattern, warm-loaded at startup via argMax. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,5 +17,19 @@ public interface DiagramStore {
|
||||
|
||||
Optional<String> findContentHashForRouteByAgents(String routeId, List<String> instanceIds);
|
||||
|
||||
/**
|
||||
* Return the most recently stored {@code content_hash} for the given
|
||||
* {@code (applicationId, environment, routeId)} triple, regardless of the
|
||||
* agent instance that produced it.
|
||||
*
|
||||
* <p>Unlike {@link #findContentHashForRoute(String, String)} and
|
||||
* {@link #findContentHashForRouteByAgents(String, List)}, this lookup is
|
||||
* independent of the agent registry — so it keeps working for routes
|
||||
* whose publishing agents have since been redeployed or removed.
|
||||
*/
|
||||
Optional<String> findLatestContentHashForAppRoute(String applicationId,
|
||||
String routeId,
|
||||
String environment);
|
||||
|
||||
Map<String, String> findProcessorRouteMapping(String applicationId, String environment);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ class ChunkAccumulatorTest {
|
||||
public Optional<com.cameleer.common.graph.RouteGraph> findByContentHash(String h) { return Optional.empty(); }
|
||||
public Optional<String> findContentHashForRoute(String r, String a) { return Optional.empty(); }
|
||||
public Optional<String> findContentHashForRouteByAgents(String r, List<String> a) { return Optional.empty(); }
|
||||
public Optional<String> findLatestContentHashForAppRoute(String app, String r, String env) { return Optional.empty(); }
|
||||
public Map<String, String> findProcessorRouteMapping(String app, String env) { return Map.of(); }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user