Observe organizational Persona feedback
This commit is contained in:
parent
bb5e749520
commit
7c0930bf93
13 changed files with 317 additions and 199 deletions
13
scripts/smoke-persona-feedback-observation.ts
Normal file
13
scripts/smoke-persona-feedback-observation.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import assert from "node:assert/strict";
|
||||
import { createHash } from "node:crypto";
|
||||
import { exportPersonaFeedbackObservation } from "../packages/core/src/persona-feedback-observation";
|
||||
|
||||
async function main(){let written: any;let puts=0;const node={put:async(_d:unknown,_k:string,v:unknown)=>{written=v;puts+=1;},get:()=>written};
|
||||
const input={guildId:"g",channelId:"c",messageId:"m",authorId:"a",authorName:"human",observedAt:"2026-07-18T00:00:00Z",addressingMode:"role" as const,content:"please inspect this",targetPersonaId:"epiphany",targetRepoName:"GameCult/Epiphany",targetRuntimeId:"epiphany-yggdrasil"};
|
||||
const config={storePath:"unused",bifrostRoot:"unused",producerRuntimeId:"voidbot-yggdrasil"};
|
||||
const id=await exportPersonaFeedbackObservation(input,config,{definition:{},openNode:async()=>node});
|
||||
assert.ok(id);assert.equal(written.authorityClass,"feedback_only");assert.equal(written.payloadHash,createHash("sha256").update("please inspect this").digest("hex"));assert.equal(written.targetRuntimeId,"epiphany-yggdrasil");
|
||||
await exportPersonaFeedbackObservation(input,config,{definition:{},openNode:async()=>node});assert.equal(puts,1);
|
||||
await assert.rejects(exportPersonaFeedbackObservation({...input,content:"different"},config,{definition:{},openNode:async()=>node}),/different immutable content/);
|
||||
console.log("persona feedback observation smoke passed");}
|
||||
void main().catch(error=>{console.error(error);process.exitCode=1;});
|
||||
35
scripts/write-persona-feedback-fixture.ts
Normal file
35
scripts/write-persona-feedback-fixture.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { exportPersonaFeedbackObservation } from "../packages/core/src/persona-feedback-observation";
|
||||
|
||||
function arg(name: string): string {
|
||||
const index = process.argv.indexOf(name);
|
||||
const value = index >= 0 ? process.argv[index + 1] : undefined;
|
||||
if (!value) throw new Error(`missing ${name}`);
|
||||
return value;
|
||||
}
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const eventId = await exportPersonaFeedbackObservation(
|
||||
{
|
||||
guildId: arg("--guild-id"),
|
||||
channelId: arg("--channel-id"),
|
||||
messageId: arg("--message-id"),
|
||||
authorId: arg("--author-id"),
|
||||
authorName: "fixture-human",
|
||||
observedAt: "2026-07-18T00:00:00Z",
|
||||
addressingMode: "role",
|
||||
content: arg("--content"),
|
||||
targetPersonaId: "epiphany",
|
||||
targetRepoName: "GameCult/Epiphany",
|
||||
targetRuntimeId: "epiphany-yggdrasil",
|
||||
},
|
||||
{
|
||||
storePath: arg("--store"),
|
||||
bifrostRoot: arg("--bifrost-root"),
|
||||
producerRuntimeId: "voidbot-yggdrasil",
|
||||
},
|
||||
);
|
||||
|
||||
process.stdout.write(`${JSON.stringify({ eventId })}\n`);
|
||||
}
|
||||
|
||||
void main();
|
||||
Loading…
Reference in a new issue