Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@ for source reference, but `gif-download` and `userbot` still depend on
before they can be built against this renamed module and are not part of this
fork's release gate.

## Fork maintenance

Upstream synchronization is selective by design. Do not merge or rebase the
whole `gotd/td` branch into this fork's release line. For every fetched upstream
range, record the old and candidate base commits, review each commit or cohesive
feature group, and replay only the selected source, runtime, diagnostic,
performance, security, and required dependency changes. Record skipped changes
and the reason they do not belong in the fork.

Upstream-generated `tg/*_gen.go` files are never copied or conflict-merged.
Schema changes enter through the versioned manifest, semantic policy audit, and
sparse AOT generation workflow documented in
[`_schema/layers/README.md`](_schema/layers/README.md). If the upstream schema
has the same Layer, normalized SHA-256, and body as the fork's canonical schema,
provenance-only differences do not trigger canonical regeneration. A candidate
upstream base becomes the documented baseline only after deterministic
generation, fork tests, downstream `telesrv` validation, and publication of a
new immutable tag.

Telegram MTProto API client in Go for users and bots.

[![Telegram: English chat](https://api.go-faster.org/badge/telegram/gotd_en?title=EN&v=1)](https://t.me/gotd_en) [![Telegram: Russian chat](https://api.go-faster.org/badge/telegram/gotd_ru?title=RU&v=1)](https://t.me/gotd_ru) [![Telegram: Chinese chat](https://api.go-faster.org/badge/telegram/gotd_zhcn?title=CN&v=1)](https://t.me/gotd_zhcn) [![Telegram: Online count](https://api.go-faster.org/badge/telegram/online?groups=gotd_ru&groups=gotd_en&groups=gotd_zhcn)](https://t.me/gotd_en)
Expand Down
28 changes: 28 additions & 0 deletions _schema/layers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,34 @@ active updates and difference responses all use `Call.EncodeResult`,
`EncodeObject` or `FrozenObject.Encode`; there is no push-specific codec and no
fallback to canonical bytes when a projection fails.

## Synchronizing `gotd/td` upstream

Upstream is an evidence and patch source, not a branch that is merged wholesale
into the fork. Every synchronization uses this sequence:

1. Fetch upstream and record the current base, candidate new base, and exact
commit range. Classify each non-merge commit or cohesive feature group as
`selected` or `skipped`, with a short reason.
2. Replay selected source/runtime changes on a dedicated fork branch. Preserve
the `github.com/iamxvbaba/td` module boundary and resolve upstream import-path
differences in source. Keep required dependency changes in the same reviewed
patch set as the feature that needs them.
3. Never copy, cherry-pick, or conflict-merge upstream-generated `tg/*_gen.go`
files. They are an oracle for schema/codegen comparison only. Fork-generated
outputs must come exclusively from the fork's manifest, semantic IR, policy,
templates, and sparse AOT emitter.
4. Compare schema Layer, normalized SHA-256, and body before importing it. An
identical schema with different generator/source header provenance is a
no-op for canonical generation. A genuinely new or changed schema must use
the import and policy-audit workflow below.
5. Run deterministic generation, targeted and full fork tests, `go vet`, source
budgets, cross-Layer wire oracles, and downstream `telesrv` validation. Only
after all gates pass may documentation adopt the candidate upstream base and
a new immutable fork tag be published.

This policy applies to every future upstream update. A full upstream
merge/rebase into the release line is not a shortcut for this review.

## Adding a Layer

1. Import the exact source from a local upstream checkout. `gotdgen` discovers
Expand Down
Loading