refactor(context): sort context blocks by descending

This commit is contained in:
2026-04-17 16:01:50 +08:00
parent 8928ec9e07
commit 3fd90c0f5b

View File

@@ -77,11 +77,10 @@ class ContextWorkspace {
val blocks = activeBlocks val blocks = activeBlocks
.sortedWith( .sortedWith(
compareBy<ResolvedContextBlock> { it.domainWeight } compareByDescending<ResolvedContextBlock> { it.domainWeight }
.thenByDescending { it.activationScore }
.thenBy { it.block.sourceKey.blockName } .thenBy { it.block.sourceKey.blockName }
.thenBy { it.block.sourceKey.source } .thenBy { it.block.sourceKey.source }
.thenBy { it.activationScore }
.thenBy { it.block.blockContent.encodeToXmlString() }
) )
.groupBy { it.block.sourceKey } .groupBy { it.block.sourceKey }
.values .values