Commit Graph

440 Commits

Author SHA1 Message Date
deploy-finalizer
999615f8cd deploy(ORCH-036): finalize SUCCESS for ORCH-099
All checks were successful
CI / test (push) Successful in 45s
2026-06-10 02:14:39 +03:00
fda1bea9b8 tester(ET): auto-commit from tester run_id=546
All checks were successful
CI / test (push) Successful in 46s
CI / test (pull_request) Successful in 51s
2026-06-10 02:09:19 +03:00
4840f3f411 reviewer(ET): auto-commit from reviewer run_id=545 2026-06-10 02:09:19 +03:00
d8793c9698 feat(metrics): lightweight read-only GET /metrics raw-signal endpoint (ORCH-099)
FND/F1a: add a versioned read-only JSON endpoint GET /metrics that exposes the
orchestrator's own raw state for the future observability sidecar F1b — active
task stages, job queue, agent-liveness (pid/runtime/cpu_ticks), and cost/tokens.
The orchestrator emits ONLY raw signal it alone knows; thresholds/alerts/history
live in the separate sidecar (observer separated from observed, BRD §1).

- src/metrics.py: new leaf collector build_metrics() (never-raise per section,
  serial_gate.snapshot() pattern); envelope schema_version/generated_at/clk_tck +
  stages/queue/agents/cost. _read_cpu_ticks(pid) reads utime+stime from
  /proc/<pid>/stat (null on None/dead/non-Linux pid — never raises).
- src/main.py: thin @app.get("/metrics") wrapper (style of GET /queue).
- src/db.py: read-only helpers get_running_agents() (dedicated SELECT, not an
  extension of the hot-path get_running_jobs()), agent_cost_totals(),
  queue_retry_stats(); job_status_counts() default dict gains the cancelled key.
- src/config.py: metrics_endpoint_enabled kill-switch (default True), env
  ORCH_METRICS_ENABLED via explicit validation_alias so the documented switch
  actually controls the flag.
- docs: README API table row + CHANGELOG entry (contract section already added
  by architect); .env.example ORCH_METRICS_ENABLED.

Strictly read-only / never-raise: STAGE_TRANSITIONS / QG_CHECKS / check_* /
machine-verdict keys / DB schema untouched; /health//status//queue byte-for-byte.
Tests: tests/test_metrics.py (TC-01..TC-11) + env-alias tests in test_config.py.
Full suite green (1482).

Refs: ORCH-099
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 02:09:19 +03:00
8988dca14d architect(ET): auto-commit from architect run_id=542 2026-06-10 02:09:19 +03:00
aa724885d1 analyst(ET): auto-commit from analyst run_id=541 2026-06-10 02:09:19 +03:00
da6e1bb9f1 docs: init ORCH-099 business request 2026-06-10 02:09:19 +03:00
5632a047d5 docs(ORCH-099): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)
All checks were successful
CI / test (pull_request) Successful in 45s
2026-06-10 02:08:40 +03:00
deploy-finalizer
dffd151434 deploy(ORCH-036): finalize SUCCESS for ORCH-027
All checks were successful
CI / test (push) Successful in 43s
CI / test (pull_request) Successful in 43s
2026-06-10 01:30:51 +03:00
c2369db808 tester(ET): auto-commit from tester run_id=539
All checks were successful
CI / test (push) Successful in 45s
CI / test (pull_request) Successful in 43s
2026-06-10 01:26:24 +03:00
4fbc8d99e3 reviewer(ET): auto-commit from reviewer run_id=538 2026-06-10 01:26:24 +03:00
feb8bc188b reviewer(ET): auto-commit from reviewer run_id=536 2026-06-10 01:26:24 +03:00
1f9c128a48 architect(ET): auto-commit from architect run_id=534 2026-06-10 01:26:24 +03:00
e9e8b1e246 architect(ET): auto-commit from architect run_id=533 2026-06-10 01:26:24 +03:00
9953275eed analyst(ET): auto-commit from analyst run_id=532 2026-06-10 01:26:24 +03:00
a37de1d890 docs: init ORCH-027 business request 2026-06-10 01:26:24 +03:00
2f72390dba docs(ORCH-027): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)
All checks were successful
CI / test (pull_request) Successful in 43s
2026-06-10 01:25:47 +03:00
9c522e9f76 docs(epic): концепция автономного саморазвития платформы (домены/вертикали/архрамки наблюдаемости) 2026-06-10 00:54:54 +03:00
deploy-finalizer
2686e3e99f deploy(ORCH-036): finalize SUCCESS for ORCH-095
All checks were successful
CI / test (push) Successful in 40s
2026-06-10 00:21:48 +03:00
cdc5e5c548 tester(ET): auto-commit from tester run_id=530
All checks were successful
CI / test (push) Successful in 41s
CI / test (pull_request) Successful in 41s
2026-06-10 00:17:26 +03:00
b77d412c36 reviewer(ET): auto-commit from reviewer run_id=529 2026-06-10 00:17:26 +03:00
6b14b07f40 architect(ET): auto-commit from architect run_id=526 2026-06-10 00:17:26 +03:00
d528f77b03 analyst(ET): auto-commit from analyst run_id=525 2026-06-10 00:17:26 +03:00
c8aab19958 docs: init ORCH-095 business request 2026-06-10 00:17:26 +03:00
7fa381d814 docs(ORCH-095): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)
All checks were successful
CI / test (pull_request) Successful in 42s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 00:16:47 +03:00
deploy-finalizer
b243343cd5 deploy(ORCH-036): finalize SUCCESS for ORCH-094
All checks were successful
CI / test (push) Successful in 43s
CI / test (pull_request) Successful in 41s
2026-06-09 23:45:46 +03:00
fe35b2224a tester(ET): auto-commit from tester run_id=523
All checks were successful
CI / test (push) Successful in 42s
CI / test (pull_request) Successful in 40s
2026-06-09 23:41:24 +03:00
08ca4ab258 reviewer(ET): auto-commit from reviewer run_id=522 2026-06-09 23:41:24 +03:00
a46dcbcab3 fix(deploy): terminal-window-aware guard so done tasks hold Done in Plane (ORCH-094)
A DB stage=done task with 0 active jobs flapped in Plane between `Awaiting
Deploy` and `Monitoring after Deploy` instead of holding `Done` (verified live
on ORCH-061, task 47): the three deploy-phase setters were terminal-blind, so
any stale/duplicate/unknown caller under the bot token re-stamped an
intermediate status over the terminal Done, forever.

- New leaf src/deploy_status_guard.py (pure, never-raise, config-gated): decide()
  -> ALLOW | CONVERGE_DONE | SUPPRESS on the entry of set_issue_awaiting_deploy /
  set_issue_deploying / set_issue_monitoring. A deploy-phase status is legitimate
  iff the task is non-terminal OR (done AND post-deploy window active); otherwise
  done converges to Done idempotently, cancelled is suppressed (FR-2, D1/D2).
- D3: move post_deploy.arm_monitor ABOVE the terminal-sync block in advance_stage
  so window_active is True when the legitimate first Monitoring is set (the task
  is already DB-done by then); a re-drive after the window closes converges to Done.
- D4: run_post_deploy_monitor no-ops without a status PATCH / re-queue when the
  task became cancelled mid-window (zombie-tick guard, FR-3).
- D5: additive `reason` kwarg on the three setters + one structured log line per
  verdict (work_item/caller/target/db_stage/window_active/verdict); new read-only
  db.get_task_by_work_item_id; post_deploy.window_active helper.
- Flags deploy_status_guard_enabled (kill-switch -> 1:1) / deploy_status_guard_repos
  (CSV; empty = self-hosting only). STAGE_TRANSITIONS / QG_CHECKS / check_* /
  machine-verdict keys / DB schema untouched (reads existing tasks.stage).

Tests: TC-01..TC-12 across 5 new test modules + config flags; updated the
reason-kwarg assertions in test_deploy_terminal_sync / test_deploy_approve.
Full regress green (1413). Docs: CHANGELOG, CLAUDE.md, docs/architecture/README.md
(status -> реализовано), .env.example.

Refs: ORCH-094

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 23:41:24 +03:00
db4dd275e4 architect(ET): auto-commit from architect run_id=520 2026-06-09 23:41:24 +03:00
8959e0e3f4 architect(ET): auto-commit from architect run_id=519 2026-06-09 23:41:24 +03:00
f36528705e analyst(ET): auto-commit from analyst run_id=518 2026-06-09 23:41:24 +03:00
5e01df00eb docs: init ORCH-094 business request 2026-06-09 23:41:24 +03:00
b86fc9043f docs(ORCH-094): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)
All checks were successful
CI / test (pull_request) Successful in 41s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 23:40:46 +03:00
deploy-finalizer
f9ce5ca1b8 deploy(ORCH-036): finalize SUCCESS for ORCH-093
All checks were successful
CI / test (push) Successful in 38s
CI / test (pull_request) Successful in 40s
2026-06-09 22:51:42 +03:00
7863932012 tester(ET): auto-commit from tester run_id=516
All checks were successful
CI / test (push) Successful in 42s
CI / test (pull_request) Successful in 39s
2026-06-09 22:47:20 +03:00
74418893d7 reviewer(ET): auto-commit from reviewer run_id=515 2026-06-09 22:47:20 +03:00
0b25fc1527 fix(merge_gate): retry transient Gitea merge errors + already-in-main guard
merge_pr now wraps ONLY the mutating POST /pulls/{n}/merge in a bounded
exponential-backoff retry-loop on TRANSIENT outcomes (405 "try again later",
408, any 5xx, network/timeout, and 409|422 while the PR is still mergeable);
TERMINAL outcomes (403/404/real conflict via mergeable==False) -> fast honest
False, so the ORCH-071/081 not-merged HOLD backstop is unchanged. Fixes the
ORCH-063 false HOLD + manual re-merge on Gitea's post-push mergeability hiccup.

ensure_open_pr gains an "already fully in main" guard (_branch_fully_in_main,
git merge-base --is-ancestor HEAD origin/main) BEFORE creating a PR -> new
"already-in-main" outcome avoids the garbage empty PR on a re-driven finalizer;
_handle_merge_verify skips merge_pr on that outcome and lets the authoritative
SHA-in-main check confirm -> done (not a HOLD). git error of the guard fails
OPEN to the create path.

New ORCH_MERGE_RETRY_* settings (kill-switch merge_retry_enabled -> one-shot,
max_attempts=3, backoff base=2/max=5). INV-4 (merge only via Gitea PR-merge API,
never push/force-push main), never-raise, STAGE_TRANSITIONS/QG_CHECKS/DB schema
unchanged. Docs (README merge-verify section, CLAUDE.md, CHANGELOG, .env.example)
updated in the same PR. Tests: test_merge_gate.py TC-01..12, test_config.py
TC-13, test_merge_verify.py TC-14..16; full suite green (1389).

Refs: ORCH-093

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 22:47:20 +03:00
3d0f51512b architect(ET): auto-commit from architect run_id=512 2026-06-09 22:47:20 +03:00
520373a694 analyst(ET): auto-commit from analyst run_id=511 2026-06-09 22:47:20 +03:00
cf0a72a46b docs: init ORCH-093 business request 2026-06-09 22:47:20 +03:00
1a52fcba9e docs(ORCH-093): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 22:46:56 +03:00
deploy-finalizer
6feae55a4b deploy(ORCH-036): finalize SUCCESS for ORCH-091
All checks were successful
CI / test (push) Successful in 32s
2026-06-09 22:13:08 +03:00
86b013c872 tester(ET): auto-commit from tester run_id=509
All checks were successful
CI / test (push) Successful in 36s
CI / test (pull_request) Successful in 33s
2026-06-09 22:08:52 +03:00
3d6e957cae reviewer(ET): auto-commit from reviewer run_id=508 2026-06-09 22:08:52 +03:00
328ae78da3 fix(notifications): tracker card — status-map completeness, rollback reflection, stage-metric summation (ORCH-091)
Three verified live-card defects in src/notifications.py (ORCH-067/087),
all additive and indication-only (STAGE_TRANSITIONS / QG_CHECKS / check_* /
transport / DB schema untouched; never-raise; revert = git revert):

- Деф.1 (D1): _STAGE_STATUS_LABEL covered 8 of 10 STAGE_TRANSITIONS keys —
  deploy-staging and cancelled (ORCH-090) fell back to the misleading
  "To Analyse". Added deploy-staging→"Deploying (staging)",
  cancelled→"Cancelled"; replaced the runtime fallback for an UNMAPPED stage
  with a neutral capitalized label (_neutral_stage_label). created stays an
  explicit "To Analyse"; broken/None input degrades safely. Map completeness
  is asserted programmatically from STAGE_TRANSITIONS.keys() (single source of
  truth), not a static list.
- Деф.2 (D2): the stage-row loop drew  for any stage with a finished agent
  run regardless of position — after a rollback the card showed the absurd
  " Внедрение + 🔄 Разработка". Added read-only _pipeline_pos from the
  STAGE_TRANSITIONS order and a suppression gate ( only when
  current_pos >= _pipeline_pos(stage_key)); deploy-staging→deploy normalization
  applied ONLY to the current position; is_active_stage untouched.
- Деф.3 (D3): _stage_line took only the LAST run (ORCH-069: developer 3 runs
  Σ $3.98 rendered ~$0.00). It now aggregates ALL of the agent's runs with the
  same per-run formulas as the task totals → strict convergence with
  SUM(agent_runs) by task_id; model/effort/attempt come from the last run.

Tests: test_tracker_status_line.py (ORCH-091 TC-01..TC-03 + updated tc06);
new test_tracker_rollback_metrics.py (TC-05..TC-08). Full suite green (1370).
Docs: CHANGELOG + internals.md (architecture README already updated by architect).

Refs: ORCH-091
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 22:08:52 +03:00
c0f2d917bf architect(ET): auto-commit from architect run_id=506 2026-06-09 22:08:52 +03:00
53022d20f4 architect(ET): auto-commit from architect run_id=505 2026-06-09 22:08:52 +03:00
852da919b9 analyst(ET): auto-commit from analyst run_id=504 2026-06-09 22:08:52 +03:00
67f7a3abfa docs: init ORCH-091 business request 2026-06-09 22:08:52 +03:00