757 Commits

Author SHA1 Message Date
deploy-finalizer
c30dc71b88 deploy(ORCH-036): finalize SUCCESS for ORCH-057
All checks were successful
CI / test (push) Successful in 44s
2026-06-10 03:09:06 +03:00
6d8b7fb934 tester(ET): auto-commit from tester run_id=555
All checks were successful
CI / test (push) Successful in 51s
CI / test (pull_request) Successful in 48s
2026-06-10 03:03:34 +03:00
5d4ef9369e reviewer(ET): auto-commit from reviewer run_id=554 2026-06-10 03:03:34 +03:00
a98d605477 feat(fs): legacy root-owned ownership detect + actionable worktree error (ORCH-057)
Follow-up ORCH-040: legacy root:root files in /repos broke worktree creation
under uid 1000 with a raw "Permission denied" (agent never started, no diagnosis).
Three additive, kill-switch-reversible layers; STAGE_TRANSITIONS / QG_CHECKS /
check_* / machine-verdict keys / DB schema are byte-for-byte unchanged.

- D1: ensure_worktree classifies the permission class and raises an actionable
  RuntimeError (cause + chown command + INFRA.md ref); non-permission errors keep
  the prior raw-stderr contract; kill-switch off -> contract 1:1 as before ORCH-057.
- D2: new never-raise leaf src/fs_normalize.py — scan_ownership (TTL-cached,
  early-exit per root), applies()-first scope (empty CSV -> self-hosting only),
  opt-in normalize() that chowns ONLY when privileged (no-op under uid 1000).
- D3: best-effort startup detect in main.lifespan (WARNING + Telegram on mismatch,
  never-fatal); read-only fs_ownership block in GET /queue; POST /fs-normalize/check.
  Claim is NOT blocked — the clear early outcome is delivered by D1 at launch.
- Docs/config: .env.example flags + CHANGELOG (architecture README / adr-0031 /
  INFRA.md procedure already landed on the branch).
- Tests: test_fs_normalize.py, test_git_worktree_perm.py,
  test_fs_normalize_startup.py, test_api_queue.py (TC-01..TC-12). Full suite green.

Refs: ORCH-057
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 03:03:34 +03:00
34778217fe developer(ET): auto-commit from developer run_id=552 2026-06-10 03:03:34 +03:00
6a923f53cb architect(ET): auto-commit from architect run_id=551 2026-06-10 03:03:34 +03:00
e7868e3fc9 architect(ET): auto-commit from architect run_id=550 2026-06-10 03:03:34 +03:00
a0659de4d2 analyst(ET): auto-commit from analyst run_id=548 2026-06-10 03:03:34 +03:00
3364436a2e docs: init ORCH-057 business request 2026-06-10 03:03:34 +03:00
7125c03d16 Merge pull request 'docs(ORCH-057): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)' (#114) from docs/ORCH-057-staging-log into main 2026-06-10 03:03:08 +03:00
78c3fe100f docs(ORCH-057): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)
All checks were successful
CI / test (pull_request) Successful in 48s
Staging suite exit 0; all REAL checks green, C9a/C9b INFRA-WAIVED (ORCH-061).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 03:02:56 +03:00
cd664b0382 Merge pull request 'feat(metrics): lightweight read-only GET /metrics raw-signal endpoint (ORCH-099)' (#111) from feature/ORCH-099-fnd-f1a-metrics-agent-liveness into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-10 02:14:40 +03:00
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
6ea732bbb4 Merge pull request 'docs(ORCH-099): staging gate log — SUCCESS' (#112) from docs/ORCH-099-staging-log into main 2026-06-10 02:08:53 +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
567c27e1d9 Merge pull request 'feat(coverage): deterministic test-coverage gate (ORCH-027)' (#109) from feature/ORCH-027-code-coverage into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-10 01:30:54 +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
78b6cdb3f1 docs(changelog): repair duplicated ORCH-095 entry body
Reviewer P1 (ORCH-027 attempt 2): inserting the ORCH-027 changelog
block duplicated the adjacent ORCH-095 entry — its paragraph body was
repeated verbatim, corrupting a golden-source doc and another work
item's artifact (CLAUDE.md §3). Remove the duplicate half, leaving a
single ORCH-095 body. ORCH-027 entry untouched (already correct).

Refs: ORCH-027

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
9647fe1ffb fix(coverage): use sys.executable for the pytest --cov subprocess (ORCH-027)
measure_coverage hardcoded "python" for the coverage subprocess; the prod container
and the CI runner expose "python3" (a bare "python" may be absent), and pytest-cov
lives in exactly the running interpreter's environment. Use sys.executable so the
measurement always runs under the same interpreter as the orchestrator.

Refs: ORCH-027
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 01:26:24 +03:00
eadfd8419b feat(coverage): deterministic test-coverage gate on deploy-staging->deploy edge (ORCH-027)
Introduce a deterministic (no-LLM) coverage sub-gate that blocks coverage
degradation before a task branch merges into `main`. Existing gates judge only by
the FACT of passing (check_ci_green / check_tests_passed / merge-gate re-test), not
by completeness — so a batch autonomous run (ORCH-088) silently erodes coverage.

Pattern mirrors the security-gate (ORCH-022): leaf src/coverage_gate.py (never-raise)
+ thin check_coverage_gate in QG_CHECKS + _handle_coverage_gate splice in advance_stage,
run AFTER merge-gate (measured on the caught-up HEAD that lands in main) and BEFORE
image-freshness (fail before the expensive docker rebuild).

- measure_coverage: pytest --cov=src --cov-report=json in the per-branch worktree ->
  line coverage %; None on tool error -> fail-open + WARNING by default (FR-6).
- compute_coverage_verdict (pure): absolute | baseline | both + epsilon (NFR-4 anti-flap);
  baseline None -> bootstrap (absolute-only).
- coverage_baseline DB table (additive, CREATE TABLE IF NOT EXISTS) + ratchet-up in
  _handle_merge_verify (deploy->done): atomic compare-and-set under merge-lease, never
  decreases; bootstrap on first merge.
- Artefact 18-coverage-report.md (coverage_status: frontmatter, single source of truth);
  GET /queue `coverage` block; FAIL -> Telegram; optional POST /coverage/baseline override.
- Flags ORCH_COVERAGE_* (kill-switch + self-hosting-only scope) -> enduro untouched;
  STAGE_TRANSITIONS / existing check_* / verdict keys byte-for-byte unchanged (NFR-5/AC-8).
- pytest-cov==5.0.0 added to requirements.txt.

Tests: tests/test_coverage_gate.py (TC-01..TC-15). Frozen QG-registry anti-regress
tests + deploy-staging edge tests updated for the new sub-gate. Full suite green.

Docs: README / adr-0029 / PIPELINE_DOCS / 18-coverage-report.md template (architecture
stage) + CHANGELOG / CLAUDE.md / .env.example (this PR).

Refs: ORCH-027
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
9e10bea500 Merge pull request 'docs(ORCH-027): staging gate log — SUCCESS' (#110) from docs/ORCH-027-staging-log into main 2026-06-10 01:25:57 +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
8c2fa5de6d Merge pull request 'fix(notifications): HTML-safe card data render — fix <1м injection freezing the tracker (ORCH-095)' (#107) from feature/ORCH-095-bug-html-1-render-task-tracker into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-10 00:21:49 +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
b38cc16041 fix(notifications): escape all card data fields at the render boundary (ORCH-095)
render_task_tracker sends/edits the live card with parse_mode=HTML. _fmt_minutes
returns the literal "<1м" for a sub-minute stage; interpolated raw into HTML text
Telegram parsed "<1м" as an opening tag -> editMessageText 400 can't parse
entities -> edit_telegram EDIT_FAILED -> update_task_tracker early return
(anti-duplicate ORCH-087) -> the card froze (incident ORCH-093, message_id 18854).

Close the whole "unescaped data in HTML text" class per ADR-001: a module-local
_esc(x)=html.escape(str(x)) (never-raise) wraps every DATA slot (durations, status
label, model, effort, token/cost metrics) exactly once at the render boundary in
render_task_tracker/_stage_line. Source functions stay HTML-agnostic (_fmt_minutes
still returns "<1м"; escape on the boundary renders it visually identical as
&lt;1м, so the visible format is unchanged). Intentional MARKUP slots (num_html /
link_for / _done_link / already-escaped esc_title) are NOT escaped, so the issue
number stays a clickable <a> tag and nothing is double-escaped.

A previously-frozen card auto-recovers on the next stage transition (a new safe
render edits in place, 200) — no new code, no touch to edit_telegram /
update_task_tracker / the orphan ledger, so the ORCH-087 anti-duplicate invariant
is preserved (a transient edit failure still does not spawn a new card).

STAGE_TRANSITIONS / QG_CHECKS / check_* / notification transport / DB schema are
untouched. New tests/test_tracker_html_escape.py (TC-01..TC-11); full suite green.

Refs: ORCH-095

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
af86c7fabb Merge pull request 'docs(ORCH-095): staging gate log — SUCCESS (8/10, C9a/C9b infra-waived)' (#108) from docs/ORCH-095-staging-log into main 2026-06-10 00:17:00 +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
e0f44cc4ef Merge pull request 'fix(deploy): terminal-window-aware guard so done tasks hold Done in Plane (ORCH-094)' (#105) from feature/ORCH-094-bug-done-deploy-plane-awaiting into main
Some checks failed
CI / test (push) Has been cancelled
2026-06-09 23:45:49 +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