diff --git a/internal/kernel/runtime.go b/internal/kernel/runtime.go index 9d36430..c2531e4 100644 --- a/internal/kernel/runtime.go +++ b/internal/kernel/runtime.go @@ -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), @@ -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) } diff --git a/internal/kernel/runtime_reactive_test.go b/internal/kernel/runtime_reactive_test.go index 8c238b4..4f960cd 100644 --- a/internal/kernel/runtime_reactive_test.go +++ b/internal/kernel/runtime_reactive_test.go @@ -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()