Skip to content

refactor(observability): re-home telemetry + monitoring onto aragora.observability (VAL-P4A-010/011)#8690

Merged
scarmani merged 1 commit into
mainfrom
structex/p4a-rehomes-tmo
Jun 29, 2026
Merged

refactor(observability): re-home telemetry + monitoring onto aragora.observability (VAL-P4A-010/011)#8690
scarmani merged 1 commit into
mainfrom
structex/p4a-rehomes-tmo

Conversation

@scarmani

Copy link
Copy Markdown
Collaborator

What

Re-home the telemetry and monitoring originals into aragora.observability, leaving deprecation-warning re-export shims at the old import paths. Part of the P4a layering foundation (milestone p4a-layering-foundation).

  • aragora/telemetry/collector.py → moved to aragora/observability/telemetry_collector.py; old path is now a pure re-export shim.
  • aragora/telemetry/research_events.py → moved to aragora/observability/research_events.py; old path is now a pure re-export shim.
  • aragora/telemetry/__init__.py keeps its existing observability re-exports and now emits a DeprecationWarning.
  • aragora/monitoring/simple_observer.py (SimpleObserver) → moved to aragora/observability/simple_observer.py; old path + package __init__ are two-sided shims emitting DeprecationWarning.

No caller migration: aragora.telemetry already had zero internal callers (floor stays 0), and the single aragora.monitoring consumer (aragora/server/handlers/admin/health/detailed.py) intentionally stays on the shim (ceiling stays at 1).

Behavior

All previously-working import paths keep working unchanged; the only new runtime behavior is a DeprecationWarning on import of the legacy modules. The moved originals are byte-identical to their previous content (the telemetry collector differs by exactly one internal import line repointed to the new research-events home).

Fulfills

  • VAL-P4A-010: aragora/telemetry/* is now original-code-free (pure re-export shims), old paths import, aragora.telemetry emits a telemetry DeprecationWarning, internal caller floor stays 0.
  • VAL-P4A-011: aragora/monitoring/* retired into observability with a two-sided shim, old path + new home import, aragora.monitoring emits a monitoring DeprecationWarning, caller ceiling stays at 1.

Validation (run in worktree with PYTHONPATH=<wt>)

  • T3 (pure shim) + T5 (allowed-imports) PASS for every tracked aragora/telemetry/*.py and aragora/monitoring/*.py.
  • T4 deprecation: aragora.telemetry (token telemetry), aragora.monitoring (token monitoring), plus the submodule shims, all PASS.
  • Old paths import: from aragora.telemetry import get_logger; from aragora.telemetry.collector import TelemetryCollector, get_telemetry_collector; from aragora.telemetry.research_events import TelemetryEvent, TelemetryEventType → ok. from aragora.monitoring import SimpleObserver → ok.
  • Caller floor (telemetry) = 0; caller ceiling (monitoring) = 1 (detailed.py).
  • ruff check + ruff format --check: clean. Changed-file mypy: no errors in the 8 changed files. make test-smoke: pass. Targeted pytest tests/telemetry tests/monitoring: 160 passed.

Risks

Low. Behavior-neutral move + shims; the only consumer of the moved code remains functional via the shim. Generated files docs/METRICS.md and aragora/module_tiers.yaml are intentionally NOT regenerated here (both are path-frozen by open PRs #8460/#8461/#8382); the structural drift is deferred to the phase merge-train's single consolidated regen.

…observability (VAL-P4A-010/011)

Move the telemetry collector + research-events originals and the monitoring
SimpleObserver into aragora/observability/, leaving DeprecationWarning re-export
shims at the legacy aragora.telemetry.* and aragora.monitoring.* paths. No caller
migration (telemetry floor stays 0; the single monitoring consumer stays on the
shim so the ceiling stays 1). Generated METRICS.md / module_tiers.yaml are not
regenerated here (path-frozen by open PRs); drift deferred to the phase merge-train.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@scarmani scarmani marked this pull request as ready for review June 29, 2026 04:46
@scarmani scarmani requested a review from an0mium as a code owner June 29, 2026 04:46
@github-actions

Copy link
Copy Markdown
Contributor

Aragora Code Review

Advisory-only review. No issues found.

@scarmani

Copy link
Copy Markdown
Collaborator Author

Claude independent model review

Reviewer: claude (anthropic) — independent adversarial model review via the Aragora Claude reviewer, grounded on the exact PR head.
Head: 00c0fe7 (00c0fe7), committed 2026-06-29T04:41:08Z.
PR: #8690.
Model family: claude

Verdict: PASS

Verified the truncated shims against the pre-PR symbol sets, smoke-tested every import path, and checked for cycles, consumers, and filterwarnings=error. The moves are verbatim, both shims re-export the complete original public surface (research_events: 2 classes + 12 constructors; collector: TelemetryBackend/InMemoryBackend/TelemetryCollector/get_/set_telemetry_collector/record_event), class identity is preserved so cross-path isinstance still holds, no import cycle, and the one live consumer (server/handlers/admin/health/detailed.py) still resolves. No correctness or regression issues.

  • [P3] aragora/monitoring/__init__.py:13-17 — the warnings.warn text says "import from aragora.observability instead," but SimpleObserver is not exposed at the package level (confirmed from aragora.observability import SimpleObserver raises ImportError); only aragora.observability.simple_observer works. Point the message at the submodule like the other three shims do, or add it to aragora/observability/__init__.
  • [P3] aragora/server/handlers/admin/health/detailed.py:349 — the sole in-repo caller still imports via the deprecated aragora.monitoring.simple_observer path, so this PR ships a self-inflicted DeprecationWarning; cheap to repoint to aragora.observability.simple_observer now.

dogfood: yes

@scarmani scarmani merged commit 2228fef into main Jun 29, 2026
157 of 160 checks passed
@scarmani scarmani deleted the structex/p4a-rehomes-tmo branch June 29, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant