ORCH-076 — ORCH-52c: единый frontmatter-контракт (reader/writer/валидатор) + спека handoff #92
Reference in New Issue
Block a user
Delete Branch "feature/ORCH-076-orch-52c-handoff-frontmatter-w"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ORCH-076 — ORCH-52c: единый frontmatter-контракт + спека handoff
Слой 2 эпика ORCH-52.
src/frontmatter.pyпревращён из single-key reader в полный машинный контракт; разрознённое чтение вердиктов пяти гейтов сведено к одной точке парсинга. Строго обратно совместимо, never-raise, нулевая поведенческая регрессия.Что сделано
src/frontmatter.py: сохранён readerread_frontmatter_value(контракт неизменен, INV-3); добавлены единый примитивparse_frontmatter(data/has_block/malformed/yaml_error), writerrender/write_frontmatter(формат совместим с существующими парсерами, round-trip), валидаторvalidate_schema/REQUIRED_FIELDS, общийstrip_frontmatter. Весь модуль never-raise.check_reviewer_verdict,_parse_tests_verdict,_parse_deploy_status,_parse_staging_status(qg/checks.py),parse_security_status(security_gate.py) делегируютparse_frontmatter; token-логика, ORCH-047 (3 поля + приоритет негатива), reason-строки, fallbackworktree→origin/main— 1:1. Сняты дубли вextract_security_findings/review_parse._strip_frontmatter.maybe_warn_schemaинертен (warning-only); hard-fail только под kill-switchfrontmatter_validation_strict(envORCH_FRONTMATTER_VALIDATION_STRICT, дефолтFalse). Схема аддитивна — старые доки читаются как раньше (FR-5/AC-4).docs/_standards/HANDOFF_PROTOCOL.md(стадия → обязательный выход + frontmatter-схема), согласована 1:1 сPIPELINE_DOCS.md.Инварианты (AC-6)
STAGE_TRANSITIONS, составQG_CHECKS, семантика вердиктов, API, схема БД — без изменений.Тесты
test_frontmatter.py(TC-01..07),test_qg_verdicts.py(TC-08..15),test_security_gate.py(TC-12),test_stages_invariants.py(TC-16). Полный регрессtests/зелёный — 1212 passed.ADR:
docs/work-items/ORCH-076/06-adr/ADR-001-frontmatter-contract.md, сквознойdocs/architecture/adr/adr-0020-frontmatter-contract.md.Refs: ORCH-076
🤖 Generated with Claude Code
src/frontmatter.py grows from a single-key reader into the full machine contract: reader (read_frontmatter_value, unchanged), one parse primitive (parse_frontmatter), writer (render/write_frontmatter), schema validator (validate_schema/REQUIRED_FIELDS, warning-only by default) and a shared strip_frontmatter helper. The five verdict gates (check_reviewer_verdict, _parse_tests_verdict, _parse_deploy_status, _parse_staging_status, parse_security_status) now read through the single parse_frontmatter point instead of duplicated ad-hoc YAML logic; review_parse._strip_frontmatter and security_gate.extract_security_findings reuse the shared helper. Strictly backward compatible + never-raise: STAGE_TRANSITIONS, the QG_CHECKS composition, verdict semantics (incl. ORCH-047 three-field tester + negative token priority), reason-strings and worktree->origin/main fallback are 1:1. The schema validator never influences a gate verdict by default; hard-fail is reserved behind the frontmatter_validation_strict kill-switch (default False). New formal handoff spec docs/_standards/HANDOFF_PROTOCOL.md ("stage -> required output" + required frontmatter schema), aligned 1:1 with PIPELINE_DOCS.md. Tests: test_frontmatter.py (TC-01..07), test_qg_verdicts.py (TC-08..15), test_security_gate.py (TC-12), test_stages_invariants.py (TC-16). Full tests/ green (1212). Refs: ORCH-076 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>eba811c993tocb9bfcff12