Skip to content

Feature: configurable natural mistakes generator for outbound text #26

Closed

Description

@Neup123

Goal

Add an opt-in Mistakes Generator to Evolution settings so outbound text can look naturally mistyped when desired.

Settings

  • enabled: on/off, default off
  • minLetters: minimum number of letters changed in an eligible message
  • maxLetters: maximum number of letters changed in an eligible message
  • probability: integer 0-100 chance that an eligible message is changed

Validation must reject invalid ranges, including negative values, percentages above 100, and minLetters > maxLetters.

Behavior

  • Apply only to outbound human-readable text, before sending.
  • When enabled and the probability roll succeeds, change a bounded number of eligible letters between minLetters and maxLetters, capped by the eligible letters available.
  • Replacements must be plausible adjacent keys for the detected character/script keyboard layout and preserve case.
  • Never alter protected/sensitive tokens. This includes full URLs and URL-like text even without a scheme, such as wikipedia.com, email addresses, mentions, phone-like identifiers, and other tokens whose corruption could change a destination or identifier.
  • If a message has no safe eligible letters, send it unchanged.
  • Keep quoted-message keys, mentions, link previews, and other message metadata intact.

Surfaces

  • Instance settings API and stored settings
  • Settings Templates, so the existing hierarchy can override the feature consistently
  • Embedded Manager settings/template UI
  • Swagger/OpenAPI and repo documentation
  • PostgreSQL and MySQL migrations

Acceptance

  • Default behavior is byte-for-byte unchanged.
  • Deterministic unit tests cover probability boundaries, min/max behavior, protected tokens, case preservation, supported keyboard layouts, and metadata preservation.
  • Existing lint, build, settings-template, review-surface, and runtime OpenAPI checks pass.

Implementation branch: instinct/mistakes-generator. Do not merge until the full implementation and checks are complete.

Activity

  1. Neup123 commented on Sep 22, 2026

    @Neup123
    OwnerAuthor

    Implemented on isolated branch instinct/mistakes-generator from main commit 1cba37f6d49dd3c087e24275e848f0a12be0f5f1.

    Implementation commit: bbaf46df892bccc7e1526674bda33311e31af9c0
    Tree: 19be31311a7e5102e6a33472dc141ef6d4db9527

    Completed:

    • instance setting and Settings Template support for enabled, minLetters, maxLetters, and 0-100 probability
    • natural adjacent-key substitutions for Latin/QWERTY, Hebrew, Cyrillic, and Arabic keyboard rows, preserving case
    • whole-token protection for HTTP(S)/www URLs, bare domains such as wikipedia.com, email addresses, mentions, and phone-like identifiers
    • immutable transformation of text/captions while preserving quoted keys, mention arrays, previews, and other message metadata
    • PostgreSQL and MySQL migrations
    • embedded Manager controls for instance settings and templates
    • generated runtime OpenAPI plus settings/template documentation
    • deterministic regression tests

    Validation passed: Mistakes Generator, Settings Templates, and review-surface regression suites; runtime OpenAPI audit for 202 operations; ESLint; TypeScript no-emit compilation; and the Manager production build.

    The full dual-format backend tsup build could not complete in this constrained worker: the first attempt exceeded 120 seconds and a CJS-only retry reported that the esbuild service stopped. GitHub branch push was attempted and failed because this environment has no writable Git credential. A fresh-clone git am proof produced the exact expected tree. Nothing was merged.

  2. Neup123 commented on Sep 22, 2026

    @Neup123
    OwnerAuthor

    Implementation review and release evidence:

    Review confirmed backend settings, PostgreSQL/MySQL migrations, instance and Settings Template controls in the embedded Manager UI, and user-facing documentation. Protected-token handling covers HTTP(S)/www URLs, bare domains, emails, mentions, and phone-like identifiers. Adjacent-key substitutions cover Latin/QWERTY, Hebrew, Cyrillic, and Arabic while preserving case and message metadata. Added review coverage for Arabic, uppercase behavior, mentions, phones, and fully protected URL-only text.

    Validation passed: Mistakes Generator, Settings Template hierarchy, review surfaces, message archive, outbound safety, message-key, and log-redaction tests; runtime OpenAPI audit (202 operations); Baileys/webhook/archive/chat documentation audits; ESLint; and TypeScript. The dual CJS+ESM tsup bundle was retried after Prisma generation but did not finish within this worker's 110-second limit, so CI remains the final full-build proof. Live-read audit requires a deployed Evolution API target and was not claimed as local proof. Archive integration test requires a configured database and was not claimed as local proof.

    No merge or change to main was made. Rollback instructions are in the release notes.

  3. Neup123 commented on Sep 22, 2026

    @Neup123
    OwnerAuthor

    Final release evidence:

    The first PR scan found a high CodeQL alert in a test-only substring assertion. The assertion was changed to compare exact protected tokens; feature tests passed, and the repeated Quality/full-build and both CodeQL checks passed before merge. The PR was merged with a true merge commit, not squash/rebase, preserving a direct revert path. Both GHCR publication runs started from the exact merge commit.

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