Skip to content

fix: recover display-name telegram authors - #13

Merged
igorrendulic merged 1 commit into
mainfrom
feat/username-exact-match-boost
Jun 26, 2026
Merged

fix: recover display-name telegram authors#13
igorrendulic merged 1 commit into
mainfrom
feat/username-exact-match-boost

Conversation

@igorrendulic

Copy link
Copy Markdown
Owner

Summary

Telegram support can now recover evidence for users whose visible author identity is stored as a display name rather than author_username. A draft-context --user crinx7 style lookup no longer falls through to missing_user_history when the local Telegram message is linked to users.display_name, and indexed chunks now render the visible author label instead of unknown.

This also cleans up noisy Telegram chunk text by dropping blank neighbor messages, and adds rebuildable language/translation helper metadata so English helper context can aid search without replacing the original Telegram text. Agent-facing instructions now treat target.language as the reply-language signal and keep translated_text as operator/helper context only.

Design Notes

  • Display-name matching is an exact fallback only when author_username is absent, so arbitrary text mentions are not promoted into author matches.
  • Original Telegram text remains the evidence source of truth; translated text is indexed and returned only as helper metadata.
  • draft-context prefers the target message language over neighboring context when drafting from a message ID.

Validation

  • uv run pytest -> 136 passed
  • git diff --check -> clean
  • Code review applied one fix: mixed-language message windows now prefer the target message language before surrounding thread language.

Known Residuals

  • Language inference is still intentionally lightweight. Latin-script non-English messages may be classified as English until a real language detector or stricter confidence policy is added.
  • Exact author lookup is correct but not yet optimized for large profiles; a normalized author key or index-backed lookup would reduce scan risk.

Post-Deploy Monitoring & Validation

  • Validation window: first local profile re-index after release.
  • Owner: support operator running the local profile.
  • Commands to validate:
    • scripts/tg-support --profile default index
    • scripts/tg-support --profile default search crinx7
    • scripts/tg-support --profile default draft-context --user crinx7
    • scripts/tg-support --profile default draft-context --message-id <known-non-English-message-id>
  • Healthy signals: display-name-only users appear with their visible author label, missing_user_history is absent for known display-name histories, blank author: lines do not appear in evidence text, and non-English target contexts include target.language when inferred.
  • Failure signals: search returns unrelated low-score results for known display-name authors, draft context reports missing_user_history for visible display-name users, or replies are guided by translated helper text rather than target language.
  • Mitigation: re-run sync and index; if the issue persists, fall back to draft-context --message-id and disable reliance on target.language until language detection is tightened.

Compound Engineering
GPT-5

@igorrendulic
igorrendulic merged commit 6039f9b into main Jun 26, 2026
4 checks passed
@igorrendulic
igorrendulic deleted the feat/username-exact-match-boost branch June 26, 2026 17:50
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