Skip to content

feat(schema): import Telegram Layer 231 and regenerate exact profiles - #3

Closed
SandyTAP wants to merge 3 commits into
iamxvbaba:mainfrom
SandyTAP:main
Closed

SandyTAP wants to merge 3 commits into
iamxvbaba:mainfrom
SandyTAP:main

Conversation

@SandyTAP

Copy link
Copy Markdown

Import the official Telegram Desktop schema for Layer 231 and regenerate the exact profiles.

Source

  • Telegram Desktop dev, commit 91ed9dbf2004ed5531a94ecc4fe5751e008dc8ed ("Update API scheme to layer 231.", 2026-10-17), reachable from fetched upstream/dev.
  • Blob 01e31d552dd496e592f262989c8452f7a3ce411a, SHA-256 0921a7bba8be9ad7e615d1d4f8e068126a421e3cba18f499a16765f1ab6129bf, both locked in manifest.json.
  • The schema is imported through the versioned manifest workflow; tg and the sparse exact-profile sidecar are regenerated from the semantic IR, never copied from an upstream generator.

Layer 231 delta against Layer 230

The delta is mechanical:

Change Decision
urlAuthResultRequest CRC #3cd623ec → #bdca6167 The older CRC stays exact for profiles 225–230. The new constructor adds request_wallet:flags.8?true, tc_session_id:flags.9?long, tc_client_id:flags.10?string.
messages.acceptUrlAuth CRC #67a3f0de → #18dd4e92 The older CRC stays exact for profiles 225–230. The new constructor adds tonconnect_session:flags.5?InputTonConnectOauthSession.
inputTonConnectOauthSession#629f66ce New type in the canonical profile only, referenced by the Layer 231 messages.acceptUrlAuth result.

No field was removed, no constructor was renamed, no historical profile gained or lost a family. The policy audit reports retained=243, stale=0, new=0, so policy.json is unchanged and no reviewed decision is weakened.

Locked generator budgets

Re-counted for the added profile: projected families 687→689, rewrite variants 2101→2107, unavailable variants 783→789, body obligation variants 212→224, field-projection obligations 181→205, new-only obligations 783→789, sparse typed codec wire budget 1500→1520 (observed 1501). The profile catalog assertion now covers 225–231.

Verification

  • go generate . is deterministic: a second run produces no churn.
  • go test ./gen ./cmd/gotdgen ./tg ./tlprofile passes.
  • Downstream telesrv builds, vets and passes internal/rpc and internal/mtprotoedge against this tree through a temporary go.work (no go.mod replace).

Review record: _schema/layers/LAYER231_REVIEW.md.

Import the official Telegram Desktop schema for Layer 231
(commit 91ed9dbf2004, blob 01e31d5, sha256 0921a7bba8be) through the
versioned manifest workflow. The canonical profile moves from 230 to 231;
profiles 225-230 remain generated.

The Layer 231 delta against Layer 230 is mechanical: urlAuthResultRequest and
messages.acceptUrlAuth gain new constructor CRCs and
inputTonConnectOauthSession is added. The policy audit retained 243 decisions,
reported no stale keys and found no new obligations, so policy.json is
unchanged.

Locked generator budgets are re-counted for the added profile: projected
families 687->689, rewrite variants 2101->2107, unavailable variants 783->789,
body obligation variants 212->224, field-projection obligations 181->205,
new-only obligations 783->789 and the sparse typed codec wire budget
1500->1520 (observed 1501). The profile catalog assertion covers 225-231.

Downstream telesrv builds, vets and passes internal/rpc and
internal/mtprotoedge against this tree through a temporary go.work.
The real-schema lock still described the 225-230 window. Layer 231 adds two
signature changes to the union (urlAuthResultRequest, messages.acceptUrlAuth),
so the union count moves 56->58 and the Layer 225 baseline 48->50.
SandyTAP added a commit to SandyTAP/gramsrv that referenced this pull request Oct 20, 2026
Server-side Layer 231 support: the URL-auth handler refuses a request that
carries a Layer 231 TON Connect OAuth session, and internal/rpc/layer231_test.go
pins the new facts (Layer 231 resolves and is canonical, an unknown future
layer is rejected, the urlAuthResultRequest constructor stays profile-exact).

This branch intentionally does not touch go.mod: the dependency must stay on
the upstream module path, so it can only be landed once upstream publishes
the tag that carries Layer 231 (PR iamxvbaba/td#3). Until then it does not
compile against the currently published release.
@iamxvbaba iamxvbaba closed this Oct 20, 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.

2 participants