fix(athena): enforce strict schema validation for council members

Add .strict() to CouncilMemberSchema to reject unknown fields like temperature. Remove unused Zod-inferred type exports. Add test verifying unknown fields are rejected.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
ismeth
2026-02-18 20:55:05 +01:00
committed by YeonGyu-Kim
parent d8c988543f
commit 197dada95e
2 changed files with 12 additions and 5 deletions

View File

@@ -111,6 +111,17 @@ describe("CouncilMemberSchema", () => {
expect(parsed.variant).toBeUndefined()
expect(parsed.name).toBeUndefined()
})
test("rejects member config with unknown fields", () => {
//#given
const config = { model: "openai/gpt-5.3-codex", temperature: 0.2 }
//#when
const result = CouncilMemberSchema.safeParse(config)
//#then
expect(result.success).toBe(false)
})
})
describe("CouncilConfigSchema", () => {

View File

@@ -16,7 +16,7 @@ export const CouncilMemberSchema = z.object({
model: ModelStringSchema,
variant: z.string().optional(),
name: z.string().optional(),
})
}).strict()
export const CouncilConfigSchema = z.object({
members: z.array(CouncilMemberSchema).min(2),
@@ -26,7 +26,3 @@ export const AthenaConfigSchema = z.object({
model: z.string().optional(),
council: CouncilConfigSchema,
})
export type CouncilMemberSchemaType = z.infer<typeof CouncilMemberSchema>
export type CouncilConfigSchemaType = z.infer<typeof CouncilConfigSchema>
export type AthenaConfigSchemaType = z.infer<typeof AthenaConfigSchema>