feat(lessons): машинный журнал уроков — аддитивная таблица + observer-leaf (ORCH-098) #118

Merged
admin merged 11 commits from feature/ORCH-098-fnd into main 2026-06-10 11:02:23 +03:00

11 Commits

Author SHA1 Message Date
deploy-finalizer
4203d93978 deploy(ORCH-036): finalize SUCCESS for ORCH-098
All checks were successful
CI / test (push) Successful in 55s
2026-06-10 11:02:22 +03:00
66700123ac docs(ORCH-098): staging gate SUCCESS — 15-staging-log.md
All checks were successful
CI / test (push) Successful in 57s
CI / test (pull_request) Successful in 1m2s
Staging suite (docker exec orchestrator-staging, port 8501) 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 10:55:51 +03:00
917acf3e1e tester(ET): auto-commit from tester run_id=582
All checks were successful
CI / test (push) Successful in 57s
CI / test (pull_request) Successful in 56s
2026-06-10 10:52:53 +03:00
de009822c0 reviewer(ET): auto-commit from reviewer run_id=581
All checks were successful
CI / test (push) Successful in 59s
CI / test (pull_request) Successful in 59s
2026-06-10 10:49:49 +03:00
21a47e85d3 fix(lessons): resolve land-race with ORCH-100 — renumber ADR 0033→0034
All checks were successful
CI / test (push) Successful in 56s
CI / test (pull_request) Successful in 55s
Merge-gate auto_rebase_onto_main bounced this branch back: ORCH-100 landed
in main first and claimed global ADR number adr-0033 (adr-0033-sidecar-watchdog),
while this branch had created adr-0033-lessons-journal. Resolved the genuine
land race:

- rebased feature/ORCH-098-fnd onto current origin/main (linear history)
- resolved docs/architecture/README.md component-list conflict — both the
  Lessons-journal and Sidecar-watchdog bullets now coexist
- renamed docs/architecture/adr/adr-0033-lessons-journal.md →
  adr-0034-lessons-journal.md (next free global ADR number) + fixed the
  in-file header
- updated all cross-references (CLAUDE.md, README.md, work-item ADR-001,
  12-review.md) 0033→0034 for the lessons journal; ORCH-100's adr-0033
  (sidecar) left intact
- recovered the ORCH-098 CHANGELOG entry silently dropped by the rebase
  auto-merge (now above ORCH-100, ADR ref corrected to 0034)

No code semantics changed; src/** auto-merged cleanly (ORCH-100 did not
touch src/**). ruff: n/a locally (CI). pytest tests/ -q: 1630 passed.

Refs: ORCH-098
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:44:34 +03:00
c01c42e532 tester(ET): auto-commit from tester run_id=578 2026-06-10 10:40:17 +03:00
eea70551e6 reviewer(ET): auto-commit from reviewer run_id=577 2026-06-10 10:40:17 +03:00
7d21625d84 feat(lessons): machine lessons-journal — additive table + observer leaf (ORCH-098)
Step 1 ("Foundation", F2) of the self-improvement epic: formalise free-text
"lessons" from memory/ into a machine-readable `lessons` table — the foundation
for the future retrospective agent (E2), the RICE prioritiser (E3) and Стрим.

- src/lessons.py: pure never-raise observer leaf (record/get/update/snapshot),
  kill-switch only, NO repo scope (observer-only; records about any repo incl.
  enduro; repo cut on the read side). Slug-convention constants.
- src/db.py: additive idempotent `lessons` table in init_db() (+3 indexes);
  nullable attribution columns from the start (NFR-6, _ensure_column forward-safe);
  helpers record_lesson/get_lessons/update_lesson/lessons_snapshot/
  lessons_recent_dup_exists (auto-dedup window).
- 4 auto-detectors (best-effort, source="auto", deduped): gate_failure
  (_handle_qg_failure_rollbacks), merge_hold (_handle_merge_verify HOLD),
  transient_retry (launcher._finalize_transient budget-exhaustion), deploy_degraded
  (post-deploy DEGRADED -> set_repo_freeze).
- src/main.py: GET /lessons, POST /lessons, POST /lessons/{id} + read-only
  `lessons` block in GET /queue; off-switch -> {"enabled": false}.
- src/config.py: lessons_enabled / lessons_query_limit_default / lessons_dedup_window_s.
- tests/test_lessons.py: TC-01..TC-12 (unit + integration), all green.
- Docs: CLAUDE.md, docs/architecture/README.md (component + schema + API), CHANGELOG.

Invariant: the journal is an OBSERVER, not a Quality Gate — STAGE_TRANSITIONS /
QG_CHECKS / check_* / machine-verdict / existing table schemas are byte-for-byte
untouched; enduro not affected. never-raise on every public fn + injection.

Refs: ORCH-098
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:40:17 +03:00
9f62df02eb architect(ET): auto-commit from architect run_id=574 2026-06-10 10:39:17 +03:00
1dc067a00c analyst(ET): auto-commit from analyst run_id=573 2026-06-10 10:37:51 +03:00
0677ea3a7e docs: init ORCH-098 business request 2026-06-10 10:37:51 +03:00