Improve block-zayin: synthesize claims by topic + fix markdown JSON parsing
block_writer: Rewrote block-zayin prompt to require synthesis by topic instead of listing each claim separately. Now produces 3 organized sections (appellants 8, committee 6, permit applicants 3+) instead of 40 scattered paragraphs. Target: 800-1500 words. claims_extractor: Fix markdown code block stripping (same bug as qa_validator had). Enables parsing claims from Claude responses wrapped in ```json blocks. Tested on Hecht: block-zayin from 40 paragraphs/1049 words to 17 organized paragraphs/1039 words. Structure now matches Dafna's original (3 parties, grouped by topic). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -105,6 +105,9 @@ async def extract_claims_with_ai(
|
||||
)
|
||||
|
||||
raw = message.content[0].text.strip()
|
||||
# Strip markdown code blocks if present
|
||||
raw = re.sub(r"^```(?:json)?\s*", "", raw)
|
||||
raw = re.sub(r"\s*```$", "", raw)
|
||||
try:
|
||||
# Extract JSON array from response
|
||||
json_match = re.search(r"\[.*\]", raw, re.DOTALL)
|
||||
|
||||
Reference in New Issue
Block a user