fix(athena): address 6 council review findings — launcher, schema, filtering, presentation
- Forward temperature and permission through council-launcher to background manager - Add LaunchInput.temperature and LaunchInput.permission to background-agent types - Extract session guard with 5-minute timeout to prevent stale council locks - Make council optional in AthenaOverrideConfigSchema for partial user overrides - Support member lookup by both name and model ID in filterCouncilMembers - Add provider/model-id format validation to CouncilMemberSchema - Fix findings-presenter group header to show finding count instead of first finding's reporter count
This commit is contained in:
@@ -5,10 +5,7 @@ import { collectCouncilResults } from "./council-result-collector"
|
||||
import { parseModelString } from "./model-parser"
|
||||
import type { CouncilConfig, CouncilExecutionResult, CouncilMemberConfig, CouncilMemberResponse } from "./types"
|
||||
|
||||
export interface CouncilLaunchInput extends LaunchInput {
|
||||
temperature?: number
|
||||
permission?: Record<string, "ask" | "allow" | "deny">
|
||||
}
|
||||
export type CouncilLaunchInput = LaunchInput
|
||||
|
||||
export interface CouncilLauncher {
|
||||
launch(input: CouncilLaunchInput): Promise<BackgroundTask>
|
||||
|
||||
@@ -117,6 +117,42 @@ describe("formatFindingsForUser", () => {
|
||||
expect(output).toContain("No synthesized findings are available")
|
||||
})
|
||||
|
||||
//#given multiple majority findings with different reporter counts
|
||||
//#when formatting is generated
|
||||
//#then group header shows the agreement level label without a misleading single count
|
||||
test("shows agreement level label in group header without single-finding count", () => {
|
||||
const result = createSynthesisResult({
|
||||
findings: [
|
||||
{
|
||||
summary: "Finding A",
|
||||
details: "Reported by 3 members",
|
||||
agreementLevel: "majority",
|
||||
reportedBy: ["OpenAI", "Claude", "Gemini"],
|
||||
assessment: { agrees: true, rationale: "Valid" },
|
||||
isFalsePositiveRisk: false,
|
||||
},
|
||||
{
|
||||
summary: "Finding B",
|
||||
details: "Reported by 2 members",
|
||||
agreementLevel: "majority",
|
||||
reportedBy: ["OpenAI", "Claude"],
|
||||
assessment: { agrees: true, rationale: "Also valid" },
|
||||
isFalsePositiveRisk: false,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const output = formatFindingsForUser(result)
|
||||
|
||||
// The header should show the level label without a misleading single-finding count
|
||||
// It should NOT use the first finding's count as the group header
|
||||
expect(output).not.toContain("## Majority Findings (3 members report this (majority))")
|
||||
expect(output).toContain("## Majority Findings")
|
||||
// Each individual finding still shows its own agreement context
|
||||
expect(output).toContain("Agreement context: 3 members report this (majority)")
|
||||
expect(output).toContain("Agreement context: 2 members report this (majority)")
|
||||
})
|
||||
|
||||
//#given a non-empty findings result
|
||||
//#when formatting is generated
|
||||
//#then output ends with an action recommendation section
|
||||
|
||||
@@ -72,8 +72,7 @@ export function formatFindingsForUser(result: SynthesisResult): string {
|
||||
return []
|
||||
}
|
||||
|
||||
const firstFinding = findings[0]
|
||||
const header = `## ${toTitle(level)} Findings (${formatAgreementLine(level, firstFinding)})`
|
||||
const header = `## ${toTitle(level)} Findings (${findings.length})`
|
||||
const entries = findings.map((finding) => formatFinding(level, finding)).join("\n\n")
|
||||
return [`${header}\n\n${entries}`]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user