3 Commits
Author SHA1 Message Date
Alexander BaranovandClaude Opus 5 c607a14f8b fix(markdown): decode a percent-encoded link before checking that it exists
Каждый markdown-рендерер процентно кодирует ссылку на файл с пробелами или
не-ASCII в имени. Проверка сравнивала закодированную форму с файловой системой и
объявляла отсутствующим файл, который лежит на месте:

  MARKDOWN_LINK_TARGET_MISSING: GitLab%2017.10.0%20%E2%86%92%20Docker%20Migration.md

Ложное срабатывание блокировало `validate` на репозитории Infra/Docker. Ссылка
декодируется перед резолвом; тест закрепляет и пробел, и то, что настоящая
битая ссылка по-прежнему находится.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 12:16:05 +03:00
Alexander BaranovandClaude Opus 5 8b6c01e942 fix(adopt): find the repeated shape below the root, and forbid the depth it is at
Правило повторяющейся формы искало каталоги-братья только среди прямых детей
корня. Репозиторий, группирующий стеки по модели деплоя, держит их в
`swarm/<stack>/` — ровно ту раскладку, ради описания которой правило и
существует, оно не видело. На Infra/Docker это давало один content root
(`docs`) и ни одного упоминания 20 стеков.

- `_repeated_shape_root` -> `_repeated_shape_roots`: кандидатами в родители
  становятся и корень, и каждый его прямой подкаталог; предлагаются ВСЕ
  подошедшие, потому что `swarm/` и `compose/` — два разных content root,
  а не конкурс между ними. Идентификатор включает путь, чтобы они не
  схлопнулись в один `stacks`.
- `forbiddenChanges`: селектор по spec 6.2 читается относительно `path`, но
  подставлялся в запрет как есть. Для корня на глубине это защищало не тот
  уровень: `swarm/` публиковал бы `*/docker-compose.y*ml`, под который ни один
  из его файлов не попадает. Теперь путь приклеивается обратно.

Тесты: три новых в test_adoption_gates.py — обнаружение под корнем, запрет на
верной глубине, два родителя одновременно. Существующий
test_two_siblings_are_not_a_repeated_shape продолжает держать порог в 3.

153 passed, mypy strict чист, repoctl validate на самом репозитории success.
Пять падений в tests-universal существовали до этого изменения и им не
затронуты — это рассинхрон спецификации с owner-гейтом, отдельная задача.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 11:53:07 +03:00
Alexander BaranovandClaude Opus 5 1ab02a257c fix(adopt,init): decide by evidence, refuse instead of defaulting
Running a full assess -> plan -> apply -> verify against Infra/LXD and
Infra/Docker in throwaway worktrees, and a bootstrap into a scratch
directory, surfaced the same two mistakes repeated across both commands:
a shape was read where evidence was available, and a missing answer became
a silent default rather than a refusal.

adopt:

- classify secret-shaped paths by content, not by filename. A live
  credential blocks; a file tracked against the repository's own ignore
  rules and a name-only match are warnings; findings name keys, never
  values. In Infra/Docker this turned 14 false blockers into 2 true ones
  and surfaced 14 files committed despite `**/.env`.
- carry assess findings into the plan and refuse while an error-severity
  finding is unresolved. An owner may accept one through
  `acknowledgedFindings` with a reason; the acknowledgement enters the
  plan and therefore planHash, so approval covers it.
- derive metadata.name from the git remote instead of the clone directory,
  and refuse to plan without a confirmed owner (runbook section 9).
- propose content roots from the whole content vocabulary rather than the
  winning type's markers, and recognise N sibling directories sharing a
  marker file as one file-set root with a selector, as runbook 7.2 already
  specified. Authority defaulted rather than derived now asks.

init: apply the guards adopt already had. Answers are validated against
the vocabularies that already existed in constants (name, type, lifecycle,
access) so init can no longer create a repository that fails its own
validate; owners are required; a directory that already holds the planned
paths is refused at plan time and pointed at adopt; and every path from a
plan is confined before the first byte is written -- init wrote outside
the repository from an edited plan.

validate: mask fenced blocks and inline code spans before scanning for
Markdown links. A PowerShell snippet in Infra/Docker's CLAUDE.md parsed as
a link and kept validate red for a reason unrelated to the repository.

paths: allow "." as a whole content-root path, never as a segment, so the
file-set root runbook 7.2 describes can be declared.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 18:10:59 +03:00