osmose.feedback

Feedback store + token check (pure core — no web/UI imports).

Bug reports / suggestions submitted from the Shiny UI are appended as JSON lines to FEEDBACK_FILE (overridable via OSMOSE_FEEDBACK_FILE). A token-gated read endpoint in app.py serves them back to a maintainer. Mirrors the repo’s JSON-on-disk convention.

Module Attributes

VALID_TYPES

this module's build_feedback_record and, earlier in the request, the submit handler's _classify_and_consume -- which must reject an unknown type BEFORE its honeypot check or the differing responses name the trap field.

Functions

append_feedback(record, *[, path])

Append one record as a JSON line (creates parent dir; POSIX flock; single-worker safe).

build_feedback_record(type, message, *[, ...])

Validated feedback record.

check_feedback_token(provided)

Constant-time token check; total (never raises).

looks_like_email(s)

Shape check only — deliberately NOT an RFC validator and NOT a deliverability check.

lookup_contact(feedback_id, *[, path])

Look up the address stored for feedback_id, or None if missing/never saved.

read_feedback(*[, path])

All records newest-first; missing file -> []; corrupt lines skipped (path resolved lazily).

save_contact(feedback_id, email, *[, path])

Store an address OUT OF BAND, keyed by feedback id.