Skip to content

feat(feedback): durably persist feedback labels - #9

Merged
codewithfourtix merged 1 commit into
mainfrom
feat/guardrails
Jun 17, 2026
Merged

codewithfourtix merged 1 commit into
mainfrom
feat/guardrails

Conversation

@codewithfourtix

Copy link
Copy Markdown
Owner

logger.audit() only writes to the daily log file, which on Railway is on the ephemeral filesystem and wiped on every redeploy — so the "was this helpful?" labels would not survive.

Add src/feedback-store.js: each feedback record (now enriched with the verdict it rates — is_fraud, warning_level, confidence, fraud_type) is appended as one JSON line to /feedback.jsonl, which lives on the existing persistent session volume, so labels accumulate across deploys. If FEEDBACK_WEBHOOK is set, the record is also POSTed there for live review. Path overridable via FEEDBACK_LOG_PATH.

Test: offline case writes to a temp path (no webhook) and asserts JSONL lines are appended and parseable.

logger.audit() only writes to the daily log file, which on Railway is on
the ephemeral filesystem and wiped on every redeploy — so the "was this
helpful?" labels would not survive.

Add src/feedback-store.js: each feedback record (now enriched with the
verdict it rates — is_fraud, warning_level, confidence, fraud_type) is
appended as one JSON line to <sessionStorage>/feedback.jsonl, which lives
on the existing persistent session volume, so labels accumulate across
deploys. If FEEDBACK_WEBHOOK is set, the record is also POSTed there for
live review. Path overridable via FEEDBACK_LOG_PATH.

Test: offline case writes to a temp path (no webhook) and asserts JSONL
lines are appended and parseable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codewithfourtix
codewithfourtix merged commit afb6516 into main Jun 17, 2026
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