Split experiments from tests

The tests/ directory held 50 laboratory programs and no tests. They model
channels, run hundreds of repetitions and write CSV, PNG and reports;
calling that a test suite blocked introducing a real one, because any
pytest run would have collected the labs and re-executed every
experiment.

- move all 50 lab programs to experiments/ with git mv, preserving history
- rewrite the 38 cross-imports between labs from tests.labNNN to
  experiments.labNNN
- leave tests/ empty for actual fast checks of protocol/
- point quick_gate and the hook at the new layout and add experiments/ to
  the syntax sweep
- update the paths quoted in the Lab042 specification and the verifier
  agent definition

This also defuses the import-time work finding without touching 41 files:
the labs still create directories and write files on import, but nothing
imports them now except the gate, which does so deliberately.

Gate passes: syntax clean, protocol imports, 15 lab modules import, 2
functional suites run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
LittleSam129
2026-08-10 14:34:58 +03:00
parent c9569164e0
commit c486039053
55 changed files with 63 additions and 62 deletions

View File

@@ -0,0 +1,54 @@
"""
Lab001. Преобразование текста в байты и биты.
Цель:
1. Взять обычную текстовую строку.
2. Преобразовать её в байты UTF-8.
3. Показать каждый байт как десятичное число.
4. Показать каждый байт как восемь бит.
5. Восстановить исходный текст.
"""
# Исходное сообщение
message = "HELLO SDR"
# Кодирование текста в байты.
# UTF-8 — способ представить символы числами.
encoded_message = message.encode("utf-8")
# Преобразование каждого байта в строку из восьми бит.
binary_message = " ".join(
f"{byte:08b}" for byte in encoded_message
)
# Обратное преобразование байтов в текст.
decoded_message = encoded_message.decode("utf-8")
print("Исходный текст:")
print(message)
print("\nОбъект bytes:")
print(encoded_message)
print("\nБайты в десятичном виде:")
print(list(encoded_message))
print("\nБайты в двоичном виде:")
print(binary_message)
print("\nПодробно по каждому символу:")
for character, byte_value in zip(message, encoded_message):
print(
f"{character!r:>4} "
f"→ число {byte_value:3d} "
f"→ биты {byte_value:08b}"
)
print("\nВосстановленный текст:")
print(decoded_message)
# Автоматическая проверка результата.
assert decoded_message == message
print("\nПроверка пройдена: исходный текст восстановлен без ошибок.")