fix(athena): implement 10 prompt audit fixes from council review
- Fix 1: Clarify 'restart at Step 3' → 'restart the council workflow from Step 3 (intent classification)'
- Fix 2: Replace {council-session-name} with static references to council_finalize archive_dir
- Fix 3: Add documenting comment for call_omo_agent in solo mode allowlist
- Fix 4: Add delegation agent rationale comment to RUNTIME_GUIDANCE_BY_INTENT
- Fix 5: Type-safe COUNCIL_INTENT_ADDENDUMS with Record<CouncilIntent, string>
- Fix 6: Clarify FREEFORM wording re COUNCIL_MEMBER_RESPONSE tag requirement
- Fix 7: Remove dead Step 15 fallback from agent.ts
- Fix 8: Add compound question intent precedence guidance
- Fix 9: Fix AUDIT double-period typo
- Fix 10: Add edge case test for extractCouncilResponse with literal tag text
This commit is contained in:
@@ -64,6 +64,26 @@ describe("extractCouncilResponse", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given response body contains literal COUNCIL_MEMBER_RESPONSE tag text", () => {
|
||||
it("#then extracts the actual tagged response, not the discussed tag", () => {
|
||||
const text = [
|
||||
"Here is my exploration log where I discuss the tag format.",
|
||||
"The system uses <COUNCIL_MEMBER_RESPONSE> tags for extraction.",
|
||||
"Now here is my actual response:",
|
||||
"<COUNCIL_MEMBER_RESPONSE>",
|
||||
"## Finding 1: Tag discussion in body",
|
||||
"The extractor uses lastIndexOf to find the opening tag.",
|
||||
"</COUNCIL_MEMBER_RESPONSE>",
|
||||
].join("\n")
|
||||
const result = extractCouncilResponse(text)
|
||||
expect(result).toEqual({
|
||||
has_response: true,
|
||||
response_complete: true,
|
||||
result: "## Finding 1: Tag discussion in body\nThe extractor uses lastIndexOf to find the opening tag.",
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given an empty string", () => {
|
||||
it("#then returns has_response false and null result", () => {
|
||||
const result = extractCouncilResponse("")
|
||||
|
||||
@@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto"
|
||||
import { writeFile, unlink, mkdir, readdir, stat } from "node:fs/promises"
|
||||
import { join } from "node:path"
|
||||
import { log } from "../../shared/logger"
|
||||
import { COUNCIL_SOLO_ADDENDUM, COUNCIL_DELEGATION_ADDENDUM, COUNCIL_INTENT_ADDENDUMS } from "../../agents/athena"
|
||||
import { COUNCIL_SOLO_ADDENDUM, COUNCIL_DELEGATION_ADDENDUM, COUNCIL_INTENT_ADDENDUMS, getValidCouncilIntents, type CouncilIntent } from "../../agents/athena"
|
||||
|
||||
const CLEANUP_DELAY_MS = 30 * 60 * 1000
|
||||
const COUNCIL_TMP_DIR = ".sisyphus/tmp"
|
||||
@@ -78,8 +78,8 @@ Returns the file path to reference in subsequent task() calls.`
|
||||
return `Invalid mode: "${args.mode}". Valid modes: "solo", "delegation".`
|
||||
}
|
||||
|
||||
const validIntents = Object.keys(COUNCIL_INTENT_ADDENDUMS)
|
||||
if (args.intent !== undefined && !validIntents.includes(args.intent.toUpperCase())) {
|
||||
const validIntents = getValidCouncilIntents()
|
||||
if (args.intent !== undefined && !(validIntents as readonly string[]).includes(args.intent.toUpperCase())) {
|
||||
return `Invalid intent: "${args.intent}". Valid intents: ${validIntents.map((i) => `"${i}"`).join(", ")}.`
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ Returns the file path to reference in subsequent task() calls.`
|
||||
const filePath = join(tmpDir, filename)
|
||||
|
||||
const modeAddendum = mode === "delegation" ? COUNCIL_DELEGATION_ADDENDUM : COUNCIL_SOLO_ADDENDUM
|
||||
const intentAddendum = resolvedIntent ? (COUNCIL_INTENT_ADDENDUMS[resolvedIntent] ?? "") : ""
|
||||
const intentAddendum = resolvedIntent ? (COUNCIL_INTENT_ADDENDUMS[resolvedIntent as CouncilIntent] ?? "") : ""
|
||||
const content = intentAddendum
|
||||
? `${modeAddendum}\n\n${intentAddendum}\n\n## Analysis Question\n\n${args.prompt}`
|
||||
: `${modeAddendum}\n\n## Analysis Question\n\n${args.prompt}`
|
||||
|
||||
Reference in New Issue
Block a user