From cf2c80e4e71cbc5886d07aca7427eb02b9120171 Mon Sep 17 00:00:00 2001 From: Heimdall Date: Tue, 10 Nov 2026 14:34:19 +0000 Subject: [PATCH] Load cultnet-ts and cultmesh-ts by their scoped names CultLib 286a9af scoped the two packages under @gamecult. The directories under packages/ keep their short names; only the bare specifiers change. Co-Authored-By: Claude Sonnet 5.5 --- tests/persona-feedback-cli.test.mjs | 2 +- tests/persona-matrix-mouth-runtime.test.mjs | 4 +++- tools/agent-transport.mjs | 2 +- tools/persona-feedback-idunn-health.mjs | 2 +- tools/persona-feedback.mjs | 2 +- tools/persona-matrix-mouth.mjs | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/persona-feedback-cli.test.mjs b/tests/persona-feedback-cli.test.mjs index cf9c026..f4fec1d 100644 --- a/tests/persona-feedback-cli.test.mjs +++ b/tests/persona-feedback-cli.test.mjs @@ -12,7 +12,7 @@ import { conversationFromDiscordMessage, discordGatewayReady } from "../tools/bi const root=resolve(import.meta.dirname,".."), cult=resolve(root,"..","CultLib"); const cr=createRequire(resolve(cult,"packages","cultcache-ts","package.json")); const mr=createRequire(resolve(cult,"packages","cultmesh-ts","package.json")); -const {defineDocumentType}=cr("@gamecult/cultcache-ts"), {CultMesh}=mr("cultmesh-ts"), defs=buildFeedbackDefinitions(defineDocumentType); +const {defineDocumentType}=cr("@gamecult/cultcache-ts"), {CultMesh}=mr("@gamecult/cultmesh-ts"), defs=buildFeedbackDefinitions(defineDocumentType); const nr=createRequire(resolve(cult,"packages","cultnet-ts","package.json")),{decode,encode}=nr("@msgpack/msgpack"); test("Bifrost admits bound feedback as pressure only and exports CultNet",async()=>{ diff --git a/tests/persona-matrix-mouth-runtime.test.mjs b/tests/persona-matrix-mouth-runtime.test.mjs index e4dcf88..0711f07 100644 --- a/tests/persona-matrix-mouth-runtime.test.mjs +++ b/tests/persona-matrix-mouth-runtime.test.mjs @@ -1,6 +1,8 @@ // The parts of the Matrix mouth that sit on CultLib: the chat_* wire documents, the // CultCache cursor and brake stores, and the CultNet RUDP endpoint. Needs the built -// CultLib TypeScript packages (CULTLIB_ROOT, else ../CultLib), like the other Bifrost tests. +// CultLib TypeScript packages (CULTLIB_ROOT, else ../CultLib), like the other Bifrost tests. CultLib's dist/ is gitignored: +// run `npm ci && npm run build:ts` there first. Since CultLib 286a9af the packages are @gamecult/cultcache-ts, +// @gamecult/cultnet-ts and @gamecult/cultmesh-ts; the directories under packages/ keep their short names. import test from "node:test"; import assert from "node:assert/strict"; import dgram from "node:dgram"; diff --git a/tools/agent-transport.mjs b/tools/agent-transport.mjs index 0940caa..42c7337 100644 --- a/tools/agent-transport.mjs +++ b/tools/agent-transport.mjs @@ -41,7 +41,7 @@ const { const { CultNetDocumentRegistry, defineCultNetDocumentBinding, -} = cultNetRequire("cultnet-ts"); +} = cultNetRequire("@gamecult/cultnet-ts"); const { encode, decode } = cultNetRequire("@msgpack/msgpack"); function resolveFirstExisting(label, candidates) { diff --git a/tools/persona-feedback-idunn-health.mjs b/tools/persona-feedback-idunn-health.mjs index d341d18..646bcfc 100644 --- a/tools/persona-feedback-idunn-health.mjs +++ b/tools/persona-feedback-idunn-health.mjs @@ -6,7 +6,7 @@ import { providerHealthIdentity, signProviderHealth } from "./bifrost-feedback-i const root=resolve(import.meta.dirname,".."),projects=resolve(root,".."),cult=resolve(process.env.VOIDBOT_CULTLIB_ROOT||resolve(projects,"CultLib")); const require=createRequire(resolve(cult,"packages","cultnet-ts","package.json")); -const {encodeCultNetMessageForWire,encodeRudpPacket}=require("cultnet-ts"),{encode}=require("@msgpack/msgpack"); +const {encodeCultNetMessageForWire,encodeRudpPacket}=require("@gamecult/cultnet-ts"),{encode}=require("@msgpack/msgpack"); const protocol="cultnet.transport.rudp.v0",schema="idunn.signed_daemon_health.v1",sourceRuntimeId="bifrost-persona-feedback"; export const signedHealthSourceRole="daemon-health-publisher"; const states=new Set(["active","warming","degraded","failed"]),reasons=new Set(["ready","starting","readiness-degraded","unavailable"]); diff --git a/tools/persona-feedback.mjs b/tools/persona-feedback.mjs index ea8e185..a49c1f4 100644 --- a/tools/persona-feedback.mjs +++ b/tools/persona-feedback.mjs @@ -95,7 +95,7 @@ async function exportSnapshot(){const n=await privateNode();await n.cache?.pullA async function readiness(){const ingressReasons=[];let identity,bindingCount=0,pendingFailedCount=0;try{identity=await loadBifrostFeedbackIdentity(resolve(options["private-key"]||defaultFeedbackIdentityPath()));}catch(error){ingressReasons.push(`identity:${error instanceof Error?error.message:String(error)}`);}let bindings=[];try{const info=await stat(privateStorePath);if(!info.isFile())throw new Error("private provider store is not a regular file");const cache=runtime.CultCache.builder().withDocumentType(defs.binding).withDocumentType(defs.actorLink).withDocumentType(defs.receipt).withDocumentType(defs.delivery).withDocumentType(defs.pendingFailure).withGenericStore(new runtime.SingleFileMessagePackBackingStore(privateStorePath)).build();await cache.pullAllBackingStores();bindings=cache.getAll(defs.binding);bindingCount=bindings.length;const admitted=new Set(cache.getAll(defs.receipt).map(value=>value.eventId));pendingFailedCount=cache.getAll(defs.pendingFailure).filter(value=>!admitted.has(value.eventId)).length;if(pendingFailedCount>0)ingressReasons.push(`pendingFailures:${pendingFailedCount}`);if(bindingCount===0)ingressReasons.push("bindings:none");}catch(error){ingressReasons.push(`privateStore:${error instanceof Error?error.message:String(error)}`);}for(const binding of bindings){try{await assertStoreSeparation(binding.deliveryStorePath);try{const info=await stat(binding.deliveryStorePath);if(!info.isFile())throw new Error("delivery path is not a regular file");await access(binding.deliveryStorePath,constants.W_OK);}catch(error){if(!error||typeof error!=="object"||error.code!=="ENOENT")throw error;await access(dirname(binding.deliveryStorePath),constants.W_OK);}}catch(error){ingressReasons.push(`binding:${binding.bindingId}:${error instanceof Error?error.message:String(error)}`);}}const reasons=[...ingressReasons],ingressReady=ingressReasons.length===0;return {schemaVersion:"bifrost.persona_feedback.readiness.v0",providerIdentityId:identity?.identityId??"",bindingCount,pendingFailedCount,ingressReady,ingressReasons,status:ingressReady?"ready":"degraded",reasons,privateStateExposed:false};} async function status(){print(await readiness());} -function loadRuntime(){const cr=createRequire(resolve(cult,"packages","cultcache-ts","package.json")),mr=createRequire(resolve(cult,"packages","cultmesh-ts","package.json")),nr=createRequire(resolve(cult,"packages","cultnet-ts","package.json")),cc=cr("@gamecult/cultcache-ts"),cn=nr("cultnet-ts"),mp=nr("@msgpack/msgpack");return {CultMesh:mr("cultmesh-ts").CultMesh,CultCache:cc.CultCache,SingleFileMessagePackBackingStore:cc.SingleFileMessagePackBackingStore,defineDocumentType:cc.defineDocumentType,CultNetDocumentRegistry:cn.CultNetDocumentRegistry,defineCultNetDocumentBinding:cn.defineCultNetDocumentBinding,cultnet:cn,msgpack:mp,encode:mp.encode,decode:mp.decode};} +function loadRuntime(){const cr=createRequire(resolve(cult,"packages","cultcache-ts","package.json")),mr=createRequire(resolve(cult,"packages","cultmesh-ts","package.json")),nr=createRequire(resolve(cult,"packages","cultnet-ts","package.json")),cc=cr("@gamecult/cultcache-ts"),cn=nr("@gamecult/cultnet-ts"),mp=nr("@msgpack/msgpack");return {CultMesh:mr("@gamecult/cultmesh-ts").CultMesh,CultCache:cc.CultCache,SingleFileMessagePackBackingStore:cc.SingleFileMessagePackBackingStore,defineDocumentType:cc.defineDocumentType,CultNetDocumentRegistry:cn.CultNetDocumentRegistry,defineCultNetDocumentBinding:cn.defineCultNetDocumentBinding,cultnet:cn,msgpack:mp,encode:mp.encode,decode:mp.decode};} function bindingId(o){return `feedback:${o["guild-id"]}:${o["channel-id"]}:${o["runtime-id"]}:${o.repo}:${o["persona-id"]}:${o["producer-id"]||"bifrost-discord"}:${o["producer-runtime-id"]}`;} function bindingIdFromAdmission(admission){const p=admission.packet;return bindingId({"guild-id":p.discordGuildId,"channel-id":p.discordChannelId,"runtime-id":p.targetRuntimeId,repo:p.targetRepository,"persona-id":p.targetPersonaId,"producer-id":admission.sourceObserverId,"producer-runtime-id":admission.sourceObserverRuntimeId});} function packetTuple(p){return [p.feedbackId,p.sourceEventId,p.sourceActorId,p.actorClassification,p.actorLinkRefs,p.discordGuildId,p.discordChannelId,p.discordMessageId,p.targetRuntimeId,p.targetRepository,p.targetPersonaId,p.sourceRoomId,p.feedbackText,p.contentSha256,p.sourceDiscussionRefs,p.sourceVisibility,p.dataClassification,p.privateStateIncluded];} diff --git a/tools/persona-matrix-mouth.mjs b/tools/persona-matrix-mouth.mjs index 21f1c7c..6480258 100644 --- a/tools/persona-matrix-mouth.mjs +++ b/tools/persona-matrix-mouth.mjs @@ -566,7 +566,7 @@ export function cultcacheState({ runtime, path }) { export function loadRuntime(cultRoot) { const at = name => createRequire(resolve(cultRoot, "packages", name, "package.json")); - const cc = at("cultcache-ts")("@gamecult/cultcache-ts"), cn = at("cultnet-ts")("cultnet-ts"), mp = at("cultnet-ts")("@msgpack/msgpack"); + const cc = at("cultcache-ts")("@gamecult/cultcache-ts"), cn = at("cultnet-ts")("@gamecult/cultnet-ts"), mp = at("cultnet-ts")("@msgpack/msgpack"); return { CultCache: cc.CultCache, SingleFileMessagePackBackingStore: cc.SingleFileMessagePackBackingStore, defineDocumentType: cc.defineDocumentType, readSingleFileStore: cc.readSingleFileStore, cultnet: cn, msgpack: mp }; }