From 1dc24ad5862f1080143c8cc7df8c29f241573c37 Mon Sep 17 00:00:00 2001 From: Sam Maassen Date: Thu, 9 Jul 2026 11:02:43 +0200 Subject: [PATCH 1/2] kernel: re-home HDC drift annotation link to WF15 contract --- internal/kernel/runtime.go | 12 ++++++++---- internal/kernel/runtime_reactive_test.go | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/internal/kernel/runtime.go b/internal/kernel/runtime.go index 9d36430..e641736 100644 --- a/internal/kernel/runtime.go +++ b/internal/kernel/runtime.go @@ -888,14 +888,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: "{semantic}", TgtURN: row.URN, - TgtPort: "tagged-in", + TgtPort: "{semantic}", + ContractURN: "urn:moos:contract:hdc-drift-annotation.v1", } rt.applyReactiveLocked(linkClaim) } diff --git a/internal/kernel/runtime_reactive_test.go b/internal/kernel/runtime_reactive_test.go index 8c238b4..e4a548f 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 == "urn:moos:contract:hdc-drift-annotation.v1" { 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() From 0ed1d70a7ce6c08e7ad2b6c9c0bac9b5bc1b6a11 Mon Sep 17 00:00:00 2001 From: Sam Maassen Date: Thu, 9 Jul 2026 12:27:46 +0200 Subject: [PATCH 2/2] kernel: hoist drift annotation semantic constants Fold Copilot PR #55 nit by centralizing semantic port + contract URN constants and reusing them in runtime tests. authored-by: agent:vscode.hp-laptop.wolfram / session:sam.kernel-proper / t250-wf11-drift-annotation-rehome --- internal/kernel/runtime.go | 12 ++++++++---- internal/kernel/runtime_reactive_test.go | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/internal/kernel/runtime.go b/internal/kernel/runtime.go index e641736..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), @@ -896,10 +900,10 @@ func (rt *Runtime) runHDCIndexAndDriftLocked(trigger graph.Envelope) { Actor: actor, RelationURN: relURN, SrcURN: claimURN, - SrcPort: "{semantic}", + SrcPort: driftAnnotationSemanticPort, TgtURN: row.URN, - TgtPort: "{semantic}", - ContractURN: "urn:moos:contract:hdc-drift-annotation.v1", + TgtPort: driftAnnotationSemanticPort, + ContractURN: driftAnnotationContractURN, } rt.applyReactiveLocked(linkClaim) } diff --git a/internal/kernel/runtime_reactive_test.go b/internal/kernel/runtime_reactive_test.go index e4a548f..4f960cd 100644 --- a/internal/kernel/runtime_reactive_test.go +++ b/internal/kernel/runtime_reactive_test.go @@ -485,7 +485,7 @@ func TestRuntime_HDCDriftEmitsClaimAndAnnotation(t *testing.T) { var annotationCount int for _, rel := range rt.state.Relations { - if rel.RewriteCategory == graph.WF15 && rel.ContractURN == "urn:moos:contract:hdc-drift-annotation.v1" { + if rel.RewriteCategory == graph.WF15 && rel.ContractURN == driftAnnotationContractURN { annotationCount++ } }