Skip to content

fix(digest): forbid invented causes and retry when the model invents numbers - #47

Merged
f1devbin merged 1 commit into
mainfrom
feat/digest-guard
Nov 21, 2026
Merged

f1devbin merged 1 commit into
mainfrom
feat/digest-guard

Conversation

@f1devbin

Copy link
Copy Markdown
Owner

The free model sometimes wrote cause and effect that the reports never state ("fees fell because traders left"), and it could invent numbers.

  • The system prompt now says facts are measurements, not explanations: no "because"/"due to"/"thanks to", no linking two facts as cause and effect. If the input gives no cause, say so or leave it out. Added bad/good examples, and a line that one week is not proof of a hypothesis either way. 200 words max.
  • New deterministic guard: every number in the draft must appear in the facts. If one does not, the model gets one corrective retry with the invented numbers listed; if the retry is still wrong, the text is kept and the problem is recorded in the week's meta.json as a warning.
  • Tests: number extraction and comparison, the retry path, the still-bad path, and warnings in meta.json. 90 tests pass.

@f1devbin
f1devbin merged commit 3b913ca into main Nov 21, 2026
1 check passed
@f1devbin
f1devbin deleted the feat/digest-guard branch November 21, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant