Skip to content

enrich_edison_response --force can destroy the answer .md it was meant to enrich #166

Description

@realmarcin

needs_enrichment puts answer_md under force (line 76), and enrich_one falls back to a placeholder when the re-fetched response carries no answer/formatted_answer (line 135), then writes unconditionally:

body = formatted_answer or answer or "(no answer field on this job's response type)"
(out_dir / f"{stem}.md").write_text(body)

Reproduced:

before:        '# VALUABLE ANSWER\nlots of curated research text'
after --force: "(no answer field on this job's response type)"

-citations.md is clobbered the same way, to _No citations parsed._.

The .md is the deliverable the credits bought, and the overwrite is irrecoverable. It triggers whenever a re-fetch returns a response type that does not carry those fields — different job types have different response classes — so a run intended to add provenance destroys the primary artifact.

Fix: only write answer_md (and citations) when a non-empty body actually came back. --force should mean "re-fetch and refresh", never "replace real content with a placeholder".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions