Proactive shape detection, existing-bot audit, and verified Rich Message spec - #2
Open
hlibsuslov wants to merge 1 commit into
Open
Proactive shape detection, existing-bot audit, and verified Rich Message spec#2hlibsuslov wants to merge 1 commit into
hlibsuslov wants to merge 1 commit into
Conversation
…ssage spec
Re-verified the whole skill against core.telegram.org on 2026-08-05. Bot API
10.2 (14 Jul 2026) is still the newest release, but several documented facts
were wrong or missing.
Corrected Rich Message facts (previously inferred and marked "(verify)"):
* InputRichBlockTable.cells is an Array of Array of RichBlockTableCell — there
is no `rows` field and no row object. The documented shape was a guess and
would have produced non-working tables.
* A cell is RichBlockTableCell {text, is_header, colspan, rowspan, align,
valign}; `text` is RichText, which may be a plain String. There is no
InputRichBlockTableCell class. Omitting `text` renders an invisible cell.
* Rich HTML tables take <tr> directly inside <table>; <thead>/<tbody> are not
supported tags. Added the bordered/striped attributes and <caption>.
* Added is_bordered, is_striped and caption to the table block.
* Type discriminators are not the class names: heading, pre, blockquote,
pullquote, mathematical_expression, voice_note.
* InputRichMessage also carries is_rtl and skip_entity_detection.
* Rich HTML supports nine more named entities than regular HTML.
* Table cells accept inline formatting only.
Promoted four limits from "secondary, unverified third-party" to documented
fact (Rich Message Limits): 500 blocks, 16 nesting levels, 50 media, 20
columns. Table rows count toward the 500-block budget.
New capabilities:
* references/content-shape-detection.md — recognize what a piece of bot text
actually is (table, list, checklist, headings) via the two-axis test, and an
act/offer/ask protocol so the agent volunteers the better rendering instead
of waiting to be asked. Includes an explicit guard against over-formatting.
* references/auditing-existing-bots.md — analyze an existing bot (repo, handler
file, or pasted snippet): text inventory, five-axis diagnosis, findings
tiered bugs/UX/polish, proposals grouped into a few ranked decisions, and the
full "rework the texts" pipeline (agree the voice on samples before bulk
rewriting).
* references/ephemeral-messages.md — the Bot API 10.2 ephemeral surface the
skill had missed entirely: 15-second reply window, callback_query_id,
admin exception, and the explicit no-delivery-guarantee contract.
Also documented skip_entity_detection as an injection surface, corrected the
sendRichMessageDraft constraints (private chats only, no direct file upload),
and added 12 activation-eval scenarios covering audit mode and detection
calibration.
There was a problem hiding this comment.
Pull request overview
This PR updates the telegram-bot-ui skill documentation to reflect Bot API 10.2 (verified 2026-08-05), corrects previously inferred Rich Message/table specs and limits, and expands the skill’s workflow to proactively detect content “shape” and to support auditing/reworking existing bots.
Changes:
- Corrected and expanded Rich Message/table specifications, limits, and safety notes based on re-verification against official docs.
- Added proactive content-shape detection guidance (act/offer/ask protocol) and an audit pipeline for existing bots.
- Documented Ephemeral Messages (Bot API 10.2) and integrated it into the UI capability/change guidance.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| SKILL.md | Updates activation scope and core workflow to include proactive shape detection and audit mode. |
| README.md | Aligns public-facing description with the new audit + proactive detection positioning and re-verification notes. |
| evals/activation-evals.md | Adds activation/eval scenarios for audit mode and proactive formatting calibration. |
| references/ui-changelog.md | Expands the Ephemeral Messages entry with key constraints (time window, delivery caveat). |
| references/telegram-capabilities.md | Updates verification date and adds clarified Rich Message fields/limits/type discriminator details. |
| references/tables.md | Rewrites table guidance to match verified object shapes and Rich HTML/Rich Markdown constraints. |
| references/streaming-and-editing.md | Clarifies sendRichMessageDraft constraints (private chats only, no direct upload, draft semantics). |
| references/security-and-escaping.md | Documents rich-only named HTML entities and automatic entity detection risk + mitigation. |
| references/official-sources.md | Updates verification timestamps and adds direct source links for newly verified Rich Message objects/limits. |
| references/limits-and-splitting.md | Promotes Rich Message limits to “official” and adds broadcast-rate notes. |
| references/format-selection.md | Adds guidance to run shape detection before choosing the rendering mechanism. |
| references/ephemeral-messages.md | New: documents Ephemeral Messages/Commands surface, constraints, and UX rules. |
| references/content-shape-detection.md | New: defines the proactive detection rubric and act/offer/ask protocol. |
| references/auditing-existing-bots.md | New: defines the audit → diagnose → propose → rework pipeline for existing bots. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+105
to
+106
| | `is_bordered` | True | *Optional.* table has borders | | ||
| | `is_striped` | True | *Optional.* table is striped | |
hlibsuslov
force-pushed
the
feat/proactive-detection-and-audit
branch
from
August 7, 2026 14:06
ba49af1 to
18aa844
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-verified the whole skill against core.telegram.org on 2026-08-05. Bot API 10.2 (14 Jul 2026) is still the newest release — nothing was missed version-wise, but several documented facts were wrong or absent.
1. Corrected Rich Message spec (was inferred, not read)
The flagship table capability was documented from a guess marked
(verify). It was wrong in three ways and would have produced non-working tables:rows: [{cells: […]}]cells:is an Array of Array ofRichBlockTableCell— norowsfield, no row object{blocks:[{type:"paragraph",…}]}RichBlockTableCell {text, is_header, colspan, rowspan, align, valign};textisRichText, which may be a plain String<thead>/<tbody><tr>goes directly inside<table>is_bordered,is_striped,captionwere missingAlso corrected:
InputRichBlockTableCellclass — input tables reuseRichBlockTableCell.textrenders an invisible cell (how you fill arowspan/colspanhole).heading,pre,blockquote,pullquote,mathematical_expression,voice_note.InputRichMessagealso carriesis_rtlandskip_entity_detection.sendRichMessageDraftis private chats only and supports no direct file upload.2. Limits promoted from "unverified" to documented
Four limits sat in a "third-party, not confirmed" section. They are officially documented under Rich Message Limits: 500 blocks, 16 nesting levels, 50 media, 20 columns.
The one that bites: table rows count toward the 500-block budget, so a long table exhausts it far sooner than the 32,768-character limit suggests.
3. New: proactive shape detection
references/content-shape-detection.md— the skill no longer waits to be asked to format something.Saved ✅stays one line.4. New: existing-bot audit and rework pipeline
references/auditing-existing-bots.md— most real work is not greenfield.Scope → text inventory → five-axis diagnosis (shape / clarity / consistency / safety / localization) → findings tiered bugs → UX → polish → proposals grouped into a few ranked decisions, not sixty questions.
For "rework all the texts": agree the voice on 2–3 samples before bulk rewriting — otherwise the pass meant to remove inconsistency creates it. Works on a pasted snippet without demanding the whole repo.
5. New: Ephemeral Messages (Bot API 10.2)
references/ephemeral-messages.md— a UI surface the skill had missed entirely: private replies to one group member, the 15-second reply window,callback_query_id, the admin exception, and the explicit delivery-is-not-guaranteed contract (so nothing load-bearing may live there alone).6. Security
Documented
skip_entity_detectionas a real injection surface: Telegram auto-detects@mentions,/commands, and phone-shaped strings in rich message bodies by default, turning untrusted text into live entities.Activation description gained audit triggers (including Russian: «проанализируй бота», «переработай тексты»); evals gained 12 scenarios covering audit mode and detection calibration.
validate_skill.pyandvalidate_references.pyboth pass with 0 warnings (SKILL.md was trimmed back under the 20,000-char progressive-disclosure threshold).