Merge phase 29 country.
ci / server (push) Failing after 3m53s
ci / client (push) Successful in 19s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 02:59:46 +03:00
co-authored by Cursor
59 changed files with 903 additions and 478 deletions
+16 -16
View File
@@ -12,32 +12,32 @@ Create выбирает страну, а не набор имён. Имена и
## Задачи
- [ ] `CountryDef` и `ClimatePresetDef` в `HSchool.Content`: страна вкладывает нынешние поля
- [x] `CountryDef` и `ClimatePresetDef` в `HSchool.Content`: страна вкладывает нынешние поля
набора имён в `names`, ссылается на пресеты списками id
- [ ] Набор имён больше не выбираемый вид; папка `namesets/` в `core` уезжает в страну
- [ ] Ваниль: одна страна `Russia` с нынешним славянским набором и хотя бы одним пресетом
- [x] Набор имён больше не выбираемый вид; папка `namesets/` в `core` уезжает в страну
- [x] Ваниль: одна страна `Russia` с нынешним славянским набором и хотя бы одним пресетом
(числа погоды можно заглушить — живая улица в фазе 32)
- [ ] `GET /api/catalog` отдаёт `countries` (`defName`, подпись, `nativeLanguages`,
- [x] `GET /api/catalog` отдаёт `countries` (`defName`, подпись, `nativeLanguages`,
`climatePresets`) вместо `nameSets`
- [ ] `POST /api/schools` принимает `countryId`; неизвестный — `400` `unknown-country`.
- [x] `POST /api/schools` принимает `countryId`; неизвестный — `400` `unknown-country`.
`nameSetId` не принимается
- [ ] Пресет климата записывается на школу: случайный из списка страны, от сида. Живой школе
- [x] Пресет климата записывается на школу: случайный из списка страны, от сида. Живой школе
его не сменить
- [ ] Форма создания: подпись «Страна»; язык — если у страны их несколько
- [ ] Старый сейв с `nameSetId: Slavic` поднимается как `Russia` + первый пресет; формат
- [x] Форма создания: подпись «Страна»; язык — если у страны их несколько
- [x] Старый сейв с `nameSetId: Slavic` поднимается как `Russia` + первый пресет; формат
новее без `countryId` — как с прочими полями сейва, школа не стартует
- [ ] `docs/protocol.md` и `AGENTS.md` (ориентир create / каталог) в том же коммите
- [ ] Золотой отпечаток ростера обновляется, если вход генератора сменил имя поля
- [x] `docs/protocol.md` и `AGENTS.md` (ориентир create / каталог) в том же коммите
- [x] Золотой отпечаток ростера обновляется, если вход генератора сменил имя поля
## Тесты, без которых фаза не закрыта
- [ ] Каталог `core` грузится; страна без имён или с неизвестным пресетом — ошибка загрузки
- [ ] Create с `countryId: Russia` и без языка даёт тот же родной язык, что прежний сид без
- [x] Каталог `core` грузится; страна без имён или с неизвестным пресетом — ошибка загрузки
- [x] Create с `countryId: Russia` и без языка даёт тот же родной язык, что прежний сид без
`nativeLanguage`
- [ ] Create с неизвестной страной — `400` `unknown-country`
- [ ] Два create с одним сидом получают один и тот же пресет
- [ ] Старый сейв без страны поднимается
- [ ] Диалог создания показывает страны, не наборы имён; смена страны обновляет список языков
- [x] Create с неизвестной страной — `400` `unknown-country`
- [x] Два create с одним сидом получают один и тот же пресет
- [x] Старый сейв без страны поднимается
- [x] Диалог создания показывает страны, не наборы имён; смена страны обновляет список языков
## Критерий готовности
+1 -1
View File
@@ -127,7 +127,7 @@
| Фаза | Статус | Зачем |
| --- | --- | --- |
| [29. Страна](29-country.md) | 🔄 | `CountryDef`, create выбирает страну, климат-пресет от сида |
| [29. Страна](29-country.md) | | `CountryDef`, create выбирает страну, климат-пресет от сида |
| [30. Слои и палитра](30-apparel-defs.md) | ✅ | Поля `ThingDef`, `ColorDef`, ванильная одежда и ноша |
| [31. Генератор одевает](31-dress-generator.md) | ⬜ | Гардероб на человеке, ноша-число, `people.json` |
+16 -14
View File
@@ -89,13 +89,15 @@ single seats field on a homeroom and the old slot rows on everything else.
Things carry `pupilSlots` — how many pupils that thing hosts. The snapshot's per-node pupil-slot
total is computed on the server.
`nameSets` is the list of placeable name packs (`defName` + label + `nativeLanguages`). Each
`nativeLanguages` entry is a skill (`defName` + label). The create dialog picks a name set and a
native language; the language list comes from that set (vanilla Slavic: Russian, Belarusian,
Ukrainian). It is independent of the UI language. Everyone in the school is generated with that
native. Other languages of the same set often appear at a low skill — a Russian speaker who
understands Belarusian. Those rolls live on the `NameSetDef` (`relatedLanguageChance` and
neighbours), not on this catalog payload.
`countries` is the list of placeable countries (`defName` + label + `nativeLanguages` +
`climatePresets`). Each `nativeLanguages` entry is a skill (`defName` + label). The create
dialog picks a country and, when that country lists more than one tongue, a native language;
the language list comes from that country (vanilla Russia: Russian, Belarusian, Ukrainian).
It is independent of the UI language. Everyone in the school is generated with that native.
Other languages of the same country often appear at a low skill — a Russian speaker who
understands Belarusian. Those rolls live on the nested names of the `CountryDef`
(`relatedLanguageChance` and neighbours), not on this catalog payload. `climatePresets` are
ids; the school rolls one at create from its seed and keeps it.
`subjects` is the list of placeable subjects (`defName`, label, `gradeMin`/`gradeMax`,
`hoursPerWeek`, `skills` with shares, and optional `room`). `room` is the RoomDef the lesson
@@ -121,7 +123,7 @@ Body:
"startDate": "2012-03-31T06:00:00Z",
"modIds": [],
"map": null,
"nameSetId": "Slavic",
"countryId": "Russia",
"nativeLanguage": null,
"seed": null
}
@@ -131,10 +133,10 @@ Body:
pack's `requires` load first (stable topological sort over the player's order). The resolved
order is returned as `modIds` on the created school and written to the save, so a restart loads
the same catalog. Omit `map` (or send `null`) to use that pack set's default layout. A supplied map is validated as a connected yard-and-rooms graph.
`nameSetId` is a `NameSetDef`; omit it to use the first placeable set in the catalog (vanilla:
`Slavic`). Unknown ids return `400` `unknown-name-set`.
`nativeLanguage` is a skill from that set's `nativeLanguages`. Omit it (or send `null`) to pick
one from the school seed. An id that is not in the set returns `400` `unknown-native-language`.
`countryId` is a `CountryDef`; omit it to use the first placeable country in the catalog (vanilla:
`Russia`). Unknown ids return `400` `unknown-country`. The old `nameSetId` field is not accepted.
`nativeLanguage` is a skill from that country's `nativeLanguages`. Omit it (or send `null`) to pick
one from the school seed. An id that is not in the country returns `400` `unknown-native-language`.
`seed` is an optional integer. Send it to reproduce a known school; omit it (or send `null`) and
the server rolls one. Existing saves keep the seed already stored in the people file.
@@ -148,8 +150,8 @@ the server rolls one. Existing saves keep the seed already stored in the people
| `400` `missing-mod` | A selected pack `requires` an id that was not selected. `missing` is that id. |
| `400` `mod-cycle` | Selected packs require each other in a cycle. |
| `400` `invalid-catalog` | The selected packs could not be loaded. |
| `400` `unknown-name-set` | `nameSetId` is not a placeable `NameSetDef` in those packs. |
| `400` `unknown-native-language` | `nativeLanguage` is not in that name set's `nativeLanguages`. |
| `400` `unknown-country` | `countryId` is not a placeable `CountryDef` in those packs. |
| `400` `unknown-native-language` | `nativeLanguage` is not in that country's `nativeLanguages`. |
| `409` `school-limit-reached` | `maxSchools` schools already exist. |
Failures are RFC 7807 problem details with an extra `code` field — that is what the UI switches on.