diff --git a/README.md b/README.md index dd95bd961b..6f527d51ec 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/_schema/layers/README.md b/_schema/layers/README.md index 0636e525ce..49734b05b5 100644 --- a/_schema/layers/README.md +++ b/_schema/layers/README.md @@ -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