Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions internal/kernel/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import (
"moos/kernel/internal/reactive"
)

const subscriberBufferSize = 64
const (
subscriberBufferSize = 64
driftAnnotationSemanticPort = "{semantic}"
driftAnnotationContractURN = graph.URN("urn:moos:contract:hdc-drift-annotation.v1")
)

// Runtime is the kernel — the effect layer wrapping the pure catamorphism.
// It holds the current graph state (derived), the append-only log (truth),
Expand Down Expand Up @@ -888,14 +892,18 @@ func (rt *Runtime) runHDCIndexAndDriftLocked(trigger graph.Envelope) {
}

linkClaim := graph.Envelope{
RewriteType: graph.LINK,
RewriteCategory: graph.WF11,
RewriteType: graph.LINK,
// Re-home drift annotations to WF15 open-semantic links.
// WF11 only declares synced-via/sync-target; the old tagged/tagged-in
// pair was rejected by the declaration gate (moos-kernel#52).
RewriteCategory: graph.WF15,
Actor: actor,
RelationURN: relURN,
SrcURN: claimURN,
SrcPort: "tagged",
SrcPort: driftAnnotationSemanticPort,
TgtURN: row.URN,
TgtPort: "tagged-in",
TgtPort: driftAnnotationSemanticPort,
ContractURN: driftAnnotationContractURN,
}
rt.applyReactiveLocked(linkClaim)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/kernel/runtime_reactive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ func TestRuntime_HDCDriftEmitsClaimAndAnnotation(t *testing.T) {

var annotationCount int
for _, rel := range rt.state.Relations {
if rel.RewriteCategory == graph.WF11 {
if rel.RewriteCategory == graph.WF15 && rel.ContractURN == driftAnnotationContractURN {
annotationCount++
}
}
if annotationCount == 0 {
t.Fatal("expected at least one WF11 drift annotation relation")
t.Fatal("expected at least one WF15 semantic drift annotation relation")
}

expressions = rt.HDCTypeExpressions()
Expand Down
Loading