Commit Graph

497 Commits

Author SHA1 Message Date
70bd68ec20 docs: init ORCH-075 business request
All checks were successful
CI / test (push) Successful in 30s
2026-06-09 12:38:54 +03:00
73d936a4c4 Merge pull request 'feat(labels): auto-mode by Plane labels — autoApprove + autoDeploy (ORCH-089)' (#89) from feature/ORCH-089-autoapprove-brd-autodeploy into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-09 12:38:52 +03:00
deploy-finalizer
a16196d68c deploy(ORCH-036): finalize SUCCESS for ORCH-089
All checks were successful
CI / test (push) Successful in 30s
2026-06-09 12:38:51 +03:00
9b3490ceaa tester(ET): auto-commit from tester run_id=445
All checks were successful
CI / test (push) Successful in 35s
CI / test (pull_request) Successful in 29s
2026-06-09 12:31:24 +03:00
3c407397da reviewer(ET): auto-commit from reviewer run_id=444 2026-06-09 12:31:24 +03:00
a6d0ba51c0 feat(labels): auto-mode by Plane labels — autoApprove + autoDeploy (ORCH-089)
Lift the two HUMAN gates that block an autonomous batch run (epic ORCH-088):
the BRD gate (analysis: manual Approved) and the prod-deploy gate (deploy
Phase A: manual Confirm Deploy, ORCH-059). Selective (a Plane label on the
issue), declarative, reversible, and WITHOUT touching a single technical check.

Additive, mirroring the conditional sub-gates (ORCH-035/043/058/088): leaf
src/labels.py (never-raise) + two point insertions + config flags.
STAGE_TRANSITIONS / QG_CHECKS / check_* / DB schema are NOT touched.

- autoApprove: врезка in _handle_analysis_approved_flow (files_ok branch) ->
  set_issue_approved + log/Telegram/Plane-comment + advance_stage(
  finished_agent=None) — the SAME path a human Approved takes (approved-via-
  status -> analysis->architecture + mark_brd_review_ended). No duplicated
  transition logic; re-entrancy safe.
- autoDeploy: врезка in _handle_self_deploy_phase_a after advance to deploy +
  clear_state -> log/Telegram/Plane-comment + _handle_self_deploy_phase_b
  (INITIATED marker, Deploying, finalizer). Only the indicative human steps are
  skipped. BR-5 holds structurally: Phase A is reached only after the green edge
  sub-gates, so autoDeploy can never deploy a broken build.
- plane_sync: fetch_issue_labels (None on error != []), get_project_labels
  ({normalized_name->uuid}, TTL cache, ambiguity sentinel), set_issue_approved.
- config flags: auto_label_enabled (kill-switch), auto_approve_label/
  auto_deploy_label, auto_label_repos (empty -> self-hosting only),
  auto_label_states_ttl_s. applies() (local) checked FIRST; has_label (network)
  only when applies==True -> zero network / zero regression when disabled (AC-8).
- Fail-safe (never auto on doubt), transparency via log+Telegram+Plane+card,
  read-only auto_labels block in GET /queue.
- Tests TC-01..TC-26 across 7 modules; docs (CLAUDE.md, architecture README,
  CHANGELOG) updated in the same PR.

Refs: ORCH-089

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 12:31:24 +03:00
f7488e9536 architect(ET): auto-commit from architect run_id=442 2026-06-09 12:31:24 +03:00
0b5fede802 analyst(ET): auto-commit from analyst run_id=441 2026-06-09 12:31:24 +03:00
cc2f1885e8 docs: init ORCH-089 business request 2026-06-09 12:31:24 +03:00
c9be0eb4c9 Merge pull request 'docs(ORCH-089): staging gate SUCCESS — 15-staging-log.md' (#90) from chore/ORCH-089-staging-log into main 2026-06-09 12:30:52 +03:00
21bde85708 docs(ORCH-089): staging gate SUCCESS — 15-staging-log.md
All checks were successful
CI / test (pull_request) Successful in 29s
Staging check 8/10 PASS, exit 0. All REAL checks green; C9a/C9b
sandbox-infra waived (ORCH-061).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 12:30:34 +03:00
7d61c820a7 Merge pull request 'feat(serial-gate): per-repo serial gate + deferred branch cut + rollback-freeze (ORCH-088)' (#88) from feature/ORCH-088-orch-88-10-20 into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-09 11:31:58 +03:00
deploy-finalizer
69f493fec5 deploy(ORCH-036): finalize SUCCESS for ORCH-088
All checks were successful
CI / test (push) Successful in 29s
2026-06-09 11:31:57 +03:00
dd4aaebe84 tester(ET): auto-commit from tester run_id=439
All checks were successful
CI / test (push) Successful in 34s
CI / test (pull_request) Successful in 32s
2026-06-09 11:24:48 +03:00
f645090e4d reviewer(ET): auto-commit from reviewer run_id=438 2026-06-09 11:24:48 +03:00
ee4773f5b0 feat(serial-gate): per-repo serial gate + deferred branch cut + rollback-freeze (ORCH-088)
Этап 1 (serial e2e) пакетного автономного режима. Новая задача репо не входит
в analysis (analyst-job не выбирается, ветка не режется), пока в репо есть более
ранняя незавершённая задача (FIFO, t2.id < jobs.task_id) ИЛИ репо заморожен.

- src/serial_gate.py — новый leaf (never-raise): build_claim_clause (fail-OPEN),
  is_repo_frozen (fail-CLOSED), set/clear_repo_freeze, serial_gate_applies, snapshot.
- src/db.py — идемпотентная миграция repo_freeze + serial_gate-фрагмент в claim_next_job.
- src/webhooks/plane.py + src/agents/launcher.py — отложенный срез ветки: start_pipeline
  не создаёт Gitea-ветку/docs для применимого репо; релокация в _materialize_deferred_branch
  на момент claim analyst-job (база = свежий origin/main с кодом предшественника, AC-6).
- src/stage_engine.py — post-deploy DEGRADED → durable per-repo freeze + Telegram-алерт.
- src/main.py — блок serial_gate в GET /queue + POST /serial-gate/unfreeze.
- src/config.py — serial_gate_enabled / serial_gate_repos / serial_gate_freeze_enabled.

FIFO-уточнение реализации (FR-2): ADR-001 D1 фиксировал t2.id != jobs.task_id; при !=
пакет одновременно созданных свежих задач взаимно блокировался бы (дедлок). t2.id <
jobs.task_id допускает самую раннюю задачу и сериализует остальные, сохраняя AC-1/R-7.

STAGE_TRANSITIONS / QG_CHECKS / check_* — без изменений. Аддитивно, под kill-switch,
never-raise, restart-safe; при выключенном флаге — нулевая регрессия (enduro не затронут).

Тесты: TC-01..TC-22 (test_serial_gate*.py + test_queue_endpoint.py); полный прогон 1114 зелёных.
Docs: README (serial gate / /queue / API / БД), CLAUDE.md, CHANGELOG.md, .env.example.

Refs: ORCH-088
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 11:24:48 +03:00
4597a8471d architect(ET): auto-commit from architect run_id=436 2026-06-09 11:24:48 +03:00
b478b38df5 analyst(ET): auto-commit from analyst run_id=435 2026-06-09 11:24:48 +03:00
99cafefba6 docs: init ORCH-088 business request 2026-06-09 11:24:48 +03:00
85cfce451f docs(ORCH-088): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 11:24:23 +03:00
a23d4c0971 Merge pull request 'fix(notifications): tracker orphan cleanup + effort + honest done-time (ORCH-087)' (#87) from feature/ORCH-087-orch-87-to-analyse-bump into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-09 10:12:06 +03:00
deploy-finalizer
49fad5e458 deploy(ORCH-036): finalize SUCCESS for ORCH-087
All checks were successful
CI / test (push) Successful in 28s
CI / test (pull_request) Successful in 28s
2026-06-09 10:12:05 +03:00
d9bb8d5fe3 tester(ET): auto-commit from tester run_id=433
All checks were successful
CI / test (push) Successful in 32s
CI / test (pull_request) Successful in 30s
2026-06-09 10:06:17 +03:00
32cc965f84 reviewer(ET): auto-commit from reviewer run_id=432 2026-06-09 10:06:17 +03:00
81fc2df8a8 fix(launcher): runs log dir from settings, not hardcoded /app (CI fix)
test_spawn_stamps_resolved_effort упал в CI с PermissionError на '/app':
launcher._spawn хардкодил output_path='/app/data/runs/{run_id}.log' и
os.makedirs('/app/data/runs'). В контейнере /app есть, на CI-хосте
(act_runner hostexecutor) — нет, makedirs бросает -> красный CI.

Фикс корня (не только теста): базовый каталог per-run логов вынесен в
Settings.runs_dir (env ORCH_RUNS_DIR, дефолт '/app/data/runs' = прод 1:1).
Новый хелпер _run_log_path(run_id) — единый источник пути, использован в
_spawn + три прежних inline-строки логов/алертов. Тест monkeypatch-ит
settings.runs_dir на tmp_path -> окружение-независим (проверено прогоном
с принудительно недоступным /app). pytest tests/ -q: 1090 passed.

STAGE_TRANSITIONS/QG_CHECKS/схема БД не тронуты. Docs: README env-таблица,
CHANGELOG.

Refs: ORCH-087
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 10:06:17 +03:00
a7b27f2235 fix(notifications): tracker orphan cleanup + effort-in-line + honest done-time (ORCH-087)
Устраняет «замёрзшие» осиротевшие карточки live-трекера и доделывает строку
стадии/итоговое время.

G1 — зачистка сирот: аддитивный леджер tracker_messages(task_id, message_id,
created_at, deleted_at) + хелперы add/get_open/mark_deleted в src/db.py. bump
теперь удаляет ВСЕ незакрытые mid задачи (а не только скаляр
tasks.tracker_message_id, сохранён как BC-указатель). Новый mid в леджер только
при успешном send (BR-6); transient-delete остаётся для ретрая; «already
gone»/>48ч закрывается. Корень бага — скалярный учёт, терявший ссылку при
гонке/delete-fail+send-ok (ADR-001 G0).

G3 — deploy-цикл: ключ confirm_deploy в _LIVE_BRANCH_LABELS (без base-alias).

BR-EFF — эффорт в строке: колонка agent_runs.effort (_ensure_column,
идемпотентно), стамп фактического resolve_agent_effort в launcher._spawn в
момент запуска; рендер `· {model} · {effort}`, пустой → суффикс опускается.

BR-G5 — честное время: done-строка `⏱️ Агенты Σ · твоё {review~cap} · общее с
ожиданием {wall}` — три независимых подписанных метрики; кап
tracker_brd_review_cap_s (ORCH_TRACKER_BRD_REVIEW_CAP_S, дефолт 2ч, маркер ~).

Инварианты: STAGE_TRANSITIONS/QG_CHECKS/стадии без изменений; миграции
аддитивны/идемпотентны (enduro не трогается); never-raise,
disable_notification, plane_issue_link (ORCH-067), disable_web_page_preview
(ORCH-080) сохранены; src/reconciler.py не эродирован (ORCH-086 на месте).

Тесты: tests/test_notifications_orphans.py (TC-01..05 + never-raise),
tests/test_tracker_effort_time.py (TC-06/11..15 + confirm_deploy),
tests/test_launcher.py::TestEffortStamp (TC-09/10). Доки: CLAUDE.md
(§Нотификации), docs/architecture/README.md (Notifications), CHANGELOG.md.

Refs: ORCH-087

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 10:06:17 +03:00
36c7a68722 architect(ET): auto-commit from architect run_id=429 2026-06-09 10:06:17 +03:00
18fb2eb17d analyst(ET): auto-commit from analyst run_id=428 2026-06-09 10:06:17 +03:00
c86dc3ca95 docs: init ORCH-087 business request 2026-06-09 10:06:17 +03:00
77714aa318 docs(ORCH-087): staging gate SUCCESS — 15-staging-log.md
Staging check suite passed (8/10 PASS, exit 0). C9a/C9b waived as
sandbox-infra (ORCH-061); all REAL checks green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 10:05:45 +03:00
493b9be9c4 Merge pull request 'fix(reconciler): terminal-skip + state_uuid dedup on F-1 path (ORCH-086)' (#86) from feature/ORCH-086-orch-86-reconciler-telegram-et into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-09 05:00:12 +03:00
deploy-finalizer
1b095282bf deploy(ORCH-036): finalize SUCCESS for ORCH-086
All checks were successful
CI / test (push) Successful in 26s
CI / test (pull_request) Successful in 26s
2026-06-09 05:00:11 +03:00
9c19588bcd tester(ET): auto-commit from tester run_id=424
All checks were successful
CI / test (push) Successful in 28s
CI / test (pull_request) Successful in 30s
2026-06-09 02:26:49 +03:00
fe3f1658ba reviewer(ET): auto-commit from reviewer run_id=423 2026-06-09 02:26:49 +03:00
595c382ac7 fix(reconciler): terminal-skip + state_uuid dedup on F-1 path
Закрывает F-1-пробел ORCH-068: терминал-исключение и in-memory dedup
(изначально только F-2) распространены на gate-side путь реконсилятора,
устраняя ложное «🔧 reconciler: ET-002 done разблокирована (потерян
webhook)» (особенно после рестарта).

- D1: новый _resolve_issue_status — один сетевой резолв Plane-статуса
  задачи за тик (states, groups, state_uuid) после дешёвых локальных
  гардов; never-raise -> ({}, {}, None) при сбое.
- D2: безусловный терминал-скип ДО Guard 2 (группа Plane completed/
  cancelled, fallback на логические ключи done/cancelled, либо стадия в
  БД орка ∈ {done, cancelled}); skipped_terminal_total++, не подчинён
  reconcile_skip_blocked_enabled.
- D3: _is_blocked_or_needs_input переиспользует резолв D1 (опц. аргументы,
  _UNSET -> самостоятельный резолв для прямых/легаси-вызовов; 1:1).
- D4: вызов _note_unblock на F-1 теперь передаёт state_uuid -> dedup
  работает на обоих путях (deduped_total++ на повторе).

Анти-регресс: легитимный unblock не-терминальной застрявшей задачи
по-прежнему advance + один Telegram. STAGE_TRANSITIONS / QG_CHECKS /
схема БД / сигнатуры advance_*/_note_unblock / форма status() / новые
флаги — без изменений; never-raise сохранён.

Тесты: tests/test_reconciler.py TC-86-01..09/11,
tests/test_reconciler_plane.py TC-86-10. Полный прогон зелёный (1069).

Refs: ORCH-086
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 02:26:49 +03:00
aa488edddf architect(ET): auto-commit from architect run_id=421 2026-06-09 02:26:49 +03:00
f2161451a0 analyst(ET): auto-commit from analyst run_id=419 2026-06-09 02:26:49 +03:00
0e7d608fc0 docs: init ORCH-086 business request 2026-06-09 02:26:49 +03:00
fb9390e216 docs(ORCH-086): staging gate log — SUCCESS (infra-waived C9a/C9b)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 02:26:25 +03:00
92817889c4 Merge pull request 'fix: disable Telegram link-preview in tracker notifications (ORCH-080)' (#85) from feature/ORCH-080-orch-52g-telegram-link-preview into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-09 01:38:16 +03:00
deploy-finalizer
baf7860822 deploy(ORCH-036): finalize SUCCESS for ORCH-080
All checks were successful
CI / test (push) Successful in 24s
CI / test (pull_request) Successful in 24s
2026-06-09 01:38:15 +03:00
2cf40c1af9 tester(ET): auto-commit from tester run_id=417
All checks were successful
CI / test (push) Successful in 28s
CI / test (pull_request) Successful in 25s
2026-06-09 01:32:53 +03:00
44ef0bb570 reviewer(ET): auto-commit from reviewer run_id=416 2026-06-09 01:32:53 +03:00
d826eacfcf fix: disable Telegram link-preview in tracker notifications (ORCH-080)
Add "disable_web_page_preview": True to the JSON payload of both
low-level Telegram primitives — send_telegram (POST /sendMessage) and
edit_telegram (POST /editMessageText). Telegram no longer expands the
Plane "Modern project management" link-preview banner under every
tracker card (bump/edit) and notify/alert message, which the default
bump mode (ORCH-067) was duplicating on each transition.

Single-point fix at the primitive level — all consumers
(update_task_tracker, notify_approve_requested, notify_error, stage
alerts from launcher/stage_engine) inherit it without code changes.
parse_mode: HTML is preserved so the ORCH-NNN issue link stays
clickable; disable_notification, bump/edit logic, the one-card-per-task
invariant, return contracts and never-raise are untouched. Unconditional,
no kill-switch (ADR-001).

Tests: tests/test_link_preview_disabled.py (TC-01..06). Docs: CHANGELOG,
CLAUDE.md, docs/architecture/README.md (Notifications component).

Refs: ORCH-080
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 01:32:53 +03:00
a482b36dae architect(ET): auto-commit from architect run_id=414 2026-06-09 01:32:53 +03:00
f452626bb8 analyst(ET): auto-commit from analyst run_id=413 2026-06-09 01:32:53 +03:00
b46fc6e51b docs: init ORCH-080 business request 2026-06-09 01:32:53 +03:00
140827f4da docs(ORCH-080): merge staging gate log (staging_status: SUCCESS)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 01:32:32 +03:00
fc29ba76ec Merge pull request 'feat(merge-verify): guarantee idempotent open code-PR before merge_pr (ORCH-082)' (#82) from feature/ORCH-082-orch-81-pr-merge-verify-hold into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-09 01:06:25 +03:00
deploy-finalizer
9834dae108 deploy(ORCH-036): finalize SUCCESS for ORCH-082
All checks were successful
CI / test (push) Successful in 24s
CI / test (pull_request) Successful in 24s
2026-06-09 01:01:56 +03:00