-
Notifications
You must be signed in to change notification settings - Fork 0
feat(25): Council vote debate loop, dual-output feed, persona SSOT #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0fb7088
feat(25-01): shared council deliberation and relationship types
moyunzero 8dac9e7
feat(25-01): npc_relationships migration, repository, and council seed
moyunzero ff68fec
feat(25-01): internal npc-relationships API and C-09 contract
moyunzero 25a4069
feat(25-02): add world-vote BullMQ queue with per-room dedupe
moyunzero af07cce
feat(25-02): vote trigger scheduler, state, and force-trigger route
moyunzero 17c624b
feat(25-02): hook enqueueWorldVoteIfDue in GameRoom ambient tick
moyunzero ff58c58
feat(25-03): world vote worker graph and queue drain
moyunzero 8520ef9
feat(25-03): deliberation sync broadcast and vote completion routes
moyunzero a6d79ac
feat(25-03): relationship delta engine for vote writeback
moyunzero 1e1e202
feat(25-05): dual-source world_history RAG helper
moyunzero dbf9350
feat(25-04): useCouncilDeliberation hook + Colyseus sync listener
moyunzero 151d93e
feat(25-05): 12-seat persona with runtime relationships
moyunzero 3850276
feat(25-04): council deliberation UI components per UI-SPEC
moyunzero bc8684c
feat(25-05): wire dual RAG and runtime persona into speak
moyunzero d446f14
feat(25-04): wire council deliberation UI in ChatPage and drawer
moyunzero 066fb87
feat(25-06): add verify-phase25 real-LLM E2E gate
moyunzero f6cd19a
docs(25-06): finalize C-07/C-09 contracts and council guardrails
moyunzero 9987853
test(25-06): fix worker tests for dual-RAG and env-isolated LLM roles
moyunzero df57a51
feat(25): ship council vote debate loop, dual-output feed, and person…
moyunzero 70b9a79
fix(25): address CodeRabbit CR — yesCount tally, speak enqueue, vote …
moyunzero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
apps/game-server/src/memory/councilRelationshipSeed.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| import { beforeEach, describe, expect, it } from "vitest"; | ||
| import { | ||
| COUNCIL_NPC_IDS, | ||
| councilIndexEdgeIds, | ||
| getPersona, | ||
| normalizeEdgeIds, | ||
| } from "@aetherlife/shared"; | ||
| import { | ||
| clearCouncilRelationshipSeedCache, | ||
| seedCouncilRelationshipsIfNeeded, | ||
| } from "./councilRelationshipSeed.js"; | ||
| import { | ||
| clearNpcRelationshipsMemory, | ||
| countRelationshipsForRoom, | ||
| councilRelationshipPairCount, | ||
| listRelationshipsForRoom, | ||
| } from "../world/npc-relationships-repository.js"; | ||
|
|
||
| describe("seedCouncilRelationshipsIfNeeded", () => { | ||
| beforeEach(() => { | ||
| delete process.env.DATABASE_URL; | ||
| clearNpcRelationshipsMemory(); | ||
| clearCouncilRelationshipSeedCache(); | ||
| }); | ||
|
|
||
| it("inserts 66 edges for a fresh room from registry", async () => { | ||
| await seedCouncilRelationshipsIfNeeded("room-rel-seed"); | ||
|
|
||
| expect(await countRelationshipsForRoom("room-rel-seed")).toBe(66); | ||
| expect(councilRelationshipPairCount()).toBe(66); | ||
|
|
||
| const edges = await listRelationshipsForRoom("room-rel-seed"); | ||
| expect(edges).toHaveLength(66); | ||
|
|
||
| for (const edge of edges) { | ||
| expect(edge.npcAId < edge.npcBId).toBe(true); | ||
| expect(COUNCIL_NPC_IDS).toContain(edge.npcAId); | ||
| expect(COUNCIL_NPC_IDS).toContain(edge.npcBId); | ||
| expect(edge.baseTag.length).toBeGreaterThan(0); | ||
| } | ||
| }); | ||
|
|
||
| it("maps registry kind to initial affection for npc-1 vs npc-4 nemesis", async () => { | ||
| await seedCouncilRelationshipsIfNeeded("room-nemesis"); | ||
|
|
||
| const normalized = normalizeEdgeIds("npc-1", "npc-4"); | ||
| const edges = await listRelationshipsForRoom("room-nemesis"); | ||
| const edge = edges.find( | ||
| (e) => e.npcAId === normalized.npcAId && e.npcBId === normalized.npcBId, | ||
| ); | ||
| expect(edge).toBeDefined(); | ||
| const councilOrder = councilIndexEdgeIds("npc-1", "npc-4"); | ||
| const rel = getPersona(councilOrder.npcAId).relationships.find( | ||
| (r) => r.targetId === councilOrder.npcBId, | ||
| ); | ||
| expect(edge!.baseTag).toBe(rel!.kind); | ||
| }); | ||
|
|
||
| it("includes edges beyond npc-1..3 (npc-7 vs npc-11)", async () => { | ||
| await seedCouncilRelationshipsIfNeeded("room-beyond-trio"); | ||
|
|
||
| const normalized = normalizeEdgeIds("npc-7", "npc-11"); | ||
| const councilOrder = councilIndexEdgeIds("npc-7", "npc-11"); | ||
| const rel = getPersona(councilOrder.npcAId).relationships.find( | ||
| (r) => r.targetId === councilOrder.npcBId, | ||
| ); | ||
| expect(rel).toBeDefined(); | ||
|
|
||
| const edge = await listRelationshipsForRoom("room-beyond-trio").then((rows) => | ||
| rows.find((e) => e.npcAId === normalized.npcAId && e.npcBId === normalized.npcBId), | ||
| ); | ||
| expect(edge?.baseTag).toBe(rel!.kind); | ||
| }); | ||
|
|
||
| it("second call does not duplicate rows", async () => { | ||
| await seedCouncilRelationshipsIfNeeded("room-idempotent-rel"); | ||
| await seedCouncilRelationshipsIfNeeded("room-idempotent-rel"); | ||
|
|
||
| expect(await countRelationshipsForRoom("room-idempotent-rel")).toBe(66); | ||
| const edges = await listRelationshipsForRoom("room-idempotent-rel"); | ||
| expect(edges).toHaveLength(66); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the minutes fixture exclude the actual proposer seat.
voteBallotsEleven()now hard-codes ballots fornpc-2…npc-12, but these cases setproposerNpcIdtonpc-2/npc-3. That means the generatedminutes.ballotsstill include the proposer and omit the wrong seat, so these tests no longer exercise the proposer-excluded contract they were updated for.Suggested fix
Also applies to: 451-451, 483-483
🤖 Prompt for AI Agents