Skip to content

Improvement: no retry/fallback strategy when grep returns zero results #6

Description

@Augustas11

Problem

The prompt has no explicit fallback instruction for zero-result grep searches. If grep returns nothing, the agent may hallucinate data, give up, or write an empty answer. There is no structured recovery path.

Suggested Fix

Add a fallback ladder to the WORKFLOW section:

If grep returns no results:
  1. Try alternate spellings and abbreviations (e.g. "pub debt" vs "public debt")
  2. Try searching index.txt for the relevant bulletin filename directly
  3. Try a broader term (drop qualifiers, search for the root noun only)
  4. Only if all three fail: state "Data not found in corpus" and write 0 to answer.txt

Impact

Medium — zero-result grep is a common failure mode for OCR-corrupted pre-1996 files and uncommon metric names. A structured fallback would recover several of the 43 always-fail questions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions