feat(journal): add Salience enum + DecisionKind.salience()
This commit is contained in:
@@ -2,7 +2,16 @@ package com.correx.core.journal.model
|
|||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
enum class DecisionKind { INTENT, STEERING, PREEMPT, APPROVAL, TRANSITION, RETRY, FAILURE, ARTIFACT }
|
enum class Salience { HIGH, LOW }
|
||||||
|
|
||||||
|
enum class DecisionKind {
|
||||||
|
INTENT, STEERING, PREEMPT, APPROVAL, TRANSITION, RETRY, FAILURE, ARTIFACT;
|
||||||
|
|
||||||
|
fun salience(): Salience = when (this) {
|
||||||
|
INTENT, STEERING, PREEMPT, APPROVAL, FAILURE -> Salience.HIGH
|
||||||
|
TRANSITION, RETRY, ARTIFACT -> Salience.LOW
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* One distilled decision. [sequence] is the source event's sessionSequence, used for
|
* One distilled decision. [sequence] is the source event's sessionSequence, used for
|
||||||
|
|||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package com.correx.core.journal.model
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
|
class DecisionKindSalienceTest {
|
||||||
|
@Test
|
||||||
|
fun `HIGH kinds cover intent steering preempt approval failure`() {
|
||||||
|
listOf(DecisionKind.INTENT, DecisionKind.STEERING, DecisionKind.PREEMPT,
|
||||||
|
DecisionKind.APPROVAL, DecisionKind.FAILURE)
|
||||||
|
.forEach { assertEquals(Salience.HIGH, it.salience(), "$it should be HIGH") }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `LOW kinds cover transition retry artifact`() {
|
||||||
|
listOf(DecisionKind.TRANSITION, DecisionKind.RETRY, DecisionKind.ARTIFACT)
|
||||||
|
.forEach { assertEquals(Salience.LOW, it.salience(), "$it should be LOW") }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `salience is exhaustive over all DecisionKind entries`() {
|
||||||
|
DecisionKind.entries.forEach { it.salience() }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user