feat(config): add councils schema and defaults

This commit is contained in:
William Valentin
2026-02-21 10:49:17 -08:00
parent bcb7e7b658
commit 8e89c7ff5d
4 changed files with 161 additions and 1 deletions
+65
View File
@@ -412,6 +412,71 @@ describe('configSchema — agent_configs', () => {
});
});
describe('configSchema — councils', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
models: { default: { provider: 'anthropic', model: 'claude-3' } },
};
it('defaults councils config with deterministic caps and group presets', () => {
const result = configSchema.parse(minimalConfig);
expect(result.councils.enabled).toBe(false);
expect(result.councils.defaults.max_rounds).toBe(2);
expect(result.councils.defaults.top_ideas_for_bridge).toBe(3);
expect(result.councils.defaults.bridge_packet_max_chars).toBe(2500);
expect(result.councils.groups.D.novelty_bias).toBe('low');
expect(result.councils.groups.P.novelty_bias).toBe('high');
expect(result.councils.meta_arbiter_agent).toBe('council_meta_arbiter');
});
it('accepts explicit councils overrides', () => {
const result = configSchema.parse({
...minimalConfig,
councils: {
enabled: true,
defaults: {
max_rounds: 3,
ideas_per_round: 5,
top_ideas_for_bridge: 2,
bridge_packet_max_chars: 1800,
bridge_field_max_bullets: 4,
bridge_entry_max_chars: 200,
novelty_delta_threshold: 5,
repetition_threshold: 80,
},
strict_grounding: true,
strict_meta_validation: true,
groups: {
D: {
arbiter_agent: 'd_arb',
freethinker_agent: 'd_ft',
group_prompt_prefix: 'd',
novelty_bias: 'low',
risk_tolerance: 'medium',
forbidden_approaches: ['x'],
},
P: {
arbiter_agent: 'p_arb',
freethinker_agent: 'p_ft',
group_prompt_prefix: 'p',
novelty_bias: 'high',
risk_tolerance: 'high',
forbidden_approaches: ['y'],
},
},
meta_arbiter_agent: 'meta',
},
});
expect(result.councils.enabled).toBe(true);
expect(result.councils.defaults.max_rounds).toBe(3);
expect(result.councils.groups.D.arbiter_agent).toBe('d_arb');
expect(result.councils.groups.P.freethinker_agent).toBe('p_ft');
expect(result.councils.strict_grounding).toBe(true);
expect(result.councils.meta_arbiter_agent).toBe('meta');
});
});
describe('configSchema — backends', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },