Understand any codebase instantly. System intelligence for codebases, built for humans and AI.
TypeScript aiai-memoryclaude-codeclicode-analysiscode-mappingcode-memorycodebase-understandingcodexdeveloper-toolsllmopenclawpersistent-memoryprogram-analysissoftware-architecturesystem-intelligencesystem-mapping
feat: add getDiffSummary — server-side diff counting without full hydration
riley0227b5b6c336704c
diff --git a/memory-layer/src/main/scala/ix/memory/db/ArangoGraphQueryApi.scala b/memory-layer/src/main/scala/ix/memory/db/ArangoGraphQueryApi.scalaindex d04033b2..9a2162c7 100644--- a/memory-layer/src/main/scala/ix/memory/db/ArangoGraphQueryApi.scala+++ b/memory-layer/src/main/scala/ix/memory/db/ArangoGraphQueryApi.scala@@ -305,6 +305,42 @@ class ArangoGraphQueryApi(client: ArangoClient) extends GraphQueryApi {} yield results.flatten}+ override def getDiffSummary(fromRev: Rev, toRev: Rev): IO[Map[String, Int]] = {+ val aql = """+ FOR n IN nodes+ FILTER n.created_rev > @fromRev AND n.created_rev <= @toRev+ COLLECT logicalId = n.logical_id+ LET atFrom = FIRST(+ FOR x IN nodes+ FILTER x.logical_id == logicalId+ AND x.created_rev <= @fromRev+ AND (x.deleted_rev == null OR @fromRev < x.deleted_rev)+ RETURN x+ )+ LET atTo = FIRST(+ FOR x IN nodes+ FILTER x.logical_id == logicalId+ AND x.created_rev <= @toRev+ AND (x.deleted_rev == null OR @toRev < x.deleted_rev)+ RETURN x+ )+ LET changeType = (atFrom == null ? "added" : (atTo == null ? "removed" : "modified"))+ COLLECT type = changeType WITH COUNT INTO cnt+ RETURN { type: type, cnt: cnt }+ """+ client.query(aql, Map(+ "fromRev" -> Long.box(fromRev.value).asInstanceOf[AnyRef],+ "toRev" -> Long.box(toRev.value).asInstanceOf[AnyRef]+ )).map { results =>+ results.flatMap { json =>+ for {+ t <- json.hcursor.downField("type").as[String].toOption+ c <- json.hcursor.downField("cnt").as[Int].toOption+ } yield t -> c+ }.toMap+ }+ }+override def resolvePrefix(prefix: String): IO[Vector[NodeId]] =client.query("""FOR n IN nodesdiff --git a/memory-layer/src/main/scala/ix/memory/db/GraphQueryApi.scala b/memory-layer/src/main/scala/ix/memory/db/GraphQueryApi.scalaindex 74c2f120..3c27bfdb 100644--- a/memory-layer/src/main/scala/ix/memory/db/GraphQueryApi.scala+++ b/memory-layer/src/main/scala/ix/memory/db/GraphQueryApi.scala@@ -19,6 +19,7 @@ trait GraphQueryApi {def getPatchesForEntity(entityId: NodeId): IO[List[Json]]def getPatchesBySource(sourceUri: String, extractor: String): IO[Vector[Json]]def getChangedEntities(fromRev: Rev, toRev: Rev): IO[Vector[(GraphNode, Option[GraphNode])]]+ def getDiffSummary(fromRev: Rev, toRev: Rev): IO[Map[String, Int]]def resolvePrefix(prefix: String): IO[Vector[NodeId]]def getSourceHashes(sourceUris: Seq[String]): IO[Map[String, String]]def expandByName(