docs: fix decode_cursor docstring found in verify

The docstring said every field is checked for the server's notation;
only i is, t is checked for type, and unknown fields are ignored. Also
note in tasks.md that the re-encoding check of 3.3 was replaced in 7.2
and fix the rules table. Behaviour of 8fe467a is unchanged; lint and
make test_isolated passed again (138 + 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 13:20:00 +03:00
co-authored by Claude Opus 5.5
parent f0e3d69570
commit 3328450805
3 changed files with 20 additions and 5 deletions
@@ -216,6 +216,19 @@ $ docker compose ps # рабочий сте
mtusi-lab3-api-5, mtusi-lab3-api-6, mtusi-lab3-haproxy-1, mtusi-lab3-postgres-1, mtusi-lab3-valkey-1 — Up (healthy)
```
## Правки по verify
Только текст: докстринг `decode_cursor` (запись проверяется у `i`, а не у
`t`; незнакомые поля игнорируются) и пометки в `tasks.md`. Поведение
`8fe467a` не меняется. После правки:
```text
$ make lint → All checks passed!
$ make test_isolated # exit 0
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
=========== 138 passed, 4 skipped, 17 deselected in 63.74s ===========
```
## 4.5. Полная проверка из чистого clone на портах по умолчанию — не делалась
Она удаляет рабочий стенд с volume (`evidence/tests/clean-clone-final.md`,
@@ -11,7 +11,7 @@
| Что правим | Правила |
|---|---|
| `student-tests/` | `student-tests.md`, `api-contract.md` |
| `src/api/schemas/` | `dto.md`, `api-contract.md` |
| `src/api/schemas/` | `api-contract.md`, `api-layer.md` (`dto.md` — для `src/schemas/**`, здесь не действует) |
| `src/api/routers/` | `api-layer.md`, `api-contract.md` |
| `src/utils/` | `api-contract.md` (пагинация), `service-layer.md` (курсор) |
@@ -115,7 +115,8 @@
- [x] 3.3 `decode_cursor` (`src/utils/cursor.py`):
- `t` и `i` — строки;
- `except` только `ValueError`;
- обратная сборка через `encode_cursor` и сравнение со входом;
- обратная сборка через `encode_cursor` и сравнение со входом
(заменена проверкой полей в 7.2);
- докстринг модуля и функции — под новое правило.
Проверка: `uv run python -c` — на всех вариантах 2.1 и на
@@ -216,7 +217,7 @@
## 6. Завершение
- [ ] 6.1 `/opsx:verify strict-id-validation`. Найденное исправить
- [x] 6.1 `/opsx:verify strict-id-validation`. Найденное исправить
новым commit с повтором затронутых проверок.
- [ ] 6.2 `/opsx:archive strict-id-validation` после ок пользователя.
Проверка: change в `openspec/changes/archive/`, активных changes нет.
+3 -2
View File
@@ -55,8 +55,9 @@ def decode_cursor(cursor: str, *, scope: str) -> CursorKey:
"""Ключ последнего элемента предыдущей страницы.
Бросает `CursorError`, если курсор не разбирается, другой версии,
выдан для другой области или его поля не того типа и не в той
записи, в которой их пишет `encode_cursor`.
выдан для другой области, `t` или `i` не строка либо `i` не в той
записи, в которой его пишет `encode_cursor`. Незнакомые поля
игнорируются.
"""
try:
padded = cursor + "=" * (-len(cursor) % 4)