init with react+axum+spacetimedb
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-26 18:06:23 +08:00
commit cbc27bad4a
20199 changed files with 883714 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { describe, expect, it } from 'vitest';
import { evaluateBranchBudget } from './branchBudgetPlanner';
describe('branchBudgetPlanner', () => {
it('reports high pressure when divergences exceed authorial budget', () => {
const status = evaluateBranchBudget({
consequenceLedger: [
{ id: '1', category: 'thread', title: 'A', summary: 'A', weight: 3, relatedIds: [], irreversible: true },
{ id: '2', category: 'thread', title: 'B', summary: 'B', weight: 3, relatedIds: [], irreversible: true },
{ id: '3', category: 'thread', title: 'C', summary: 'C', weight: 3, relatedIds: [], irreversible: true },
{ id: '4', category: 'thread', title: 'D', summary: 'D', weight: 3, relatedIds: [], irreversible: true },
],
authorialConstraintPack: {
toneRules: [],
noGoPatterns: [],
branchBudget: {
maxMajorDivergences: 3,
maxEndingFamilies: 5,
},
mandatoryThemes: [],
requiredPayoffs: [],
},
endingFamilyCount: 1,
});
expect(status.pressure).toBe('high');
expect(status.issues.length).toBeGreaterThan(0);
});
});