Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

fix: correct data model types per spec (Option[String], NodeId, Vector)

riley022712cc02aeb614
diff --git a/memory-layer/src/main/scala/ix/memory/model/Claim.scala b/memory-layer/src/main/scala/ix/memory/model/Claim.scala
index ba1a287d..46bfec32 100644
--- a/memory-layer/src/main/scala/ix/memory/model/Claim.scala
+++ b/memory-layer/src/main/scala/ix/memory/model/Claim.scala
@@ -1,7 +1,5 @@
package ix.memory.model
-import java.util.UUID
-
import io.circe.{Decoder, Encoder}
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder}
@@ -30,7 +28,7 @@ object ClaimStatus {
final case class Claim(
id: ClaimId,
- entityId: UUID,
+ entityId: NodeId,
statement: String,
status: ClaimStatus,
provenance: Provenance,
diff --git a/memory-layer/src/main/scala/ix/memory/model/ConflictSet.scala b/memory-layer/src/main/scala/ix/memory/model/ConflictSet.scala
index 68d0d21b..859fadb6 100644
--- a/memory-layer/src/main/scala/ix/memory/model/ConflictSet.scala
+++ b/memory-layer/src/main/scala/ix/memory/model/ConflictSet.scala
@@ -30,7 +30,7 @@ final case class ConflictSet(
id: ConflictId,
reason: String,
status: ConflictStatus,
- candidateClaims: List[ClaimId],
+ candidateClaims: Vector[ClaimId],
winnerClaimId: Option[ClaimId],
createdRev: Rev
)
diff --git a/memory-layer/src/main/scala/ix/memory/model/GraphPatch.scala b/memory-layer/src/main/scala/ix/memory/model/GraphPatch.scala
index a895c57b..e8f7428d 100644
--- a/memory-layer/src/main/scala/ix/memory/model/GraphPatch.scala
+++ b/memory-layer/src/main/scala/ix/memory/model/GraphPatch.scala
@@ -54,8 +54,8 @@ final case class GraphPatch(
timestamp: Instant,
source: PatchSource,
baseRev: Rev,
- ops: List[PatchOp],
- replaces: Option[PatchId],
+ ops: Vector[PatchOp],
+ replaces: Vector[PatchId],
intent: Option[String]
)
diff --git a/memory-layer/src/main/scala/ix/memory/model/Provenance.scala b/memory-layer/src/main/scala/ix/memory/model/Provenance.scala
index e916379b..ea931763 100644
--- a/memory-layer/src/main/scala/ix/memory/model/Provenance.scala
+++ b/memory-layer/src/main/scala/ix/memory/model/Provenance.scala
@@ -61,7 +61,7 @@ object SourceType {
final case class Provenance(
sourceUri: String,
- sourceHash: String,
+ sourceHash: Option[String],
extractor: String,
sourceType: SourceType,
observedAt: Instant
diff --git a/memory-layer/src/test/scala/ix/memory/model/ModelSpec.scala b/memory-layer/src/test/scala/ix/memory/model/ModelSpec.scala
index 5dab0893..7b9539ea 100644
--- a/memory-layer/src/test/scala/ix/memory/model/ModelSpec.scala
+++ b/memory-layer/src/test/scala/ix/memory/model/ModelSpec.scala
@@ -113,7 +113,7 @@ class ModelSpec extends AnyFlatSpec with Matchers {
"Provenance" should "round-trip through JSON" in {
val prov = Provenance(
sourceUri = "git://repo/file.scala",
- sourceHash = "abc123",
+ sourceHash = Some("abc123"),
extractor = "tree-sitter",
sourceType = SourceType.Code,
observedAt = Instant.parse("2025-01-01T00:00:00Z")
@@ -135,13 +135,13 @@ class ModelSpec extends AnyFlatSpec with Matchers {
val prov = Provenance(
sourceUri = "git://repo/file.scala",
- sourceHash = "def456",
+ sourceHash = Some("def456"),
extractor = "tree-sitter",
sourceType = SourceType.Code,
observedAt = Instant.parse("2025-06-01T12:00:00Z")
)
- val ops: List[PatchOp] = List(
+ val ops: Vector[PatchOp] = Vector(
PatchOp.UpsertNode(
GraphNode(
id = nodeId,
@@ -173,7 +173,7 @@ class ModelSpec extends AnyFlatSpec with Matchers {
PatchOp.AssertClaim(
Claim(
id = claimId,
- entityId = nodeId.value,
+ entityId = nodeId,
statement = "function foo is pure",
status = ClaimStatus.Active,
provenance = prov,
@@ -192,7 +192,7 @@ class ModelSpec extends AnyFlatSpec with Matchers {
source = PatchSource(uri = "git://repo", ref = Some("main")),
baseRev = Rev(0L),
ops = ops,
- replaces = None,
+ replaces = Vector.empty,
intent = Some("initial extraction")
)