Skip to content

Persist autodiscovery telemetry to Postgres#72

Merged
jbarnes850 merged 2 commits intomainfrom
feature/issue-71-telemetry
Oct 22, 2025
Merged

Persist autodiscovery telemetry to Postgres#72
jbarnes850 merged 2 commits intomainfrom
feature/issue-71-telemetry

Conversation

@jbarnes850
Copy link
Copy Markdown
Contributor

@jbarnes850 jbarnes850 commented Oct 22, 2025

This pull request introduces a new hint-less learning evaluation workflow to the Atlas SDK, adds persistent telemetry for discovery and runtime runs, and provides utilities for generating learning evaluation reports from stored telemetry. The changes improve how learning sessions and discovery runs are tracked, stored, and analyzed, enabling richer insights and easier reporting. The most important changes are as follows:

Learning Evaluation Workflow & Documentation

  • Added support for hint-less learning evaluation, allowing telemetry persisted to Postgres to be analyzed for reward stats, adaptive mode history, and trajectory events. Users can now run scripts/eval_learning.py to generate JSON and Markdown summaries before experience hints are available. The documentation (README.md) now references the new workflow and its guide (docs/learning_eval.md). [1] [2]

Telemetry Persistence

  • Implemented persist_discovery_run in atlas/cli/persistence.py to log discovery and runtime telemetry into Postgres, making it possible to track and analyze runs over time. This is now integrated into both the discovery and runtime CLI flows (atlas/cli/env.py, atlas/cli/utils.py). [1] [2] [3] [4] [5]
  • Added the log_discovery_run method to atlas/runtime/storage/database.py to support writing discovery run data to the database.

Session & Event Metadata Improvements

  • Improved normalization and propagation of execution_mode and other metadata in session payloads and event records, ensuring more accurate tracking of adaptive modes and review statuses for each session. [1] [2] [3]

Learning Evaluation Utilities

  • Added atlas/evaluation/learning_report.py with utilities to build learning evaluation reports from database telemetry, including session snapshots, reward statistics, adaptive mode distribution, review status counts, and references to discovery runs. Includes Markdown and dict summary generation for reporting.

Database API Enhancements

  • Extended the database API to support fetching sessions by learning key, collecting trajectory events, and retrieving discovery runs and reward baselines for evaluation purposes. [1] [2]

These changes make it easier to persist, retrieve, and analyze agent learning data, laying the foundation for advanced evaluation and continuous improvement workflows.

- add discovery_runs table and CLI helper to persist atlas env init/atlas run telemetry when STORAGE__DATABASE_URL is set
- populate exporter events with event_type metadata for downstream learning harnesses
- cover persistence/export paths with focused tests

Tests: pytest tests/test_env_discovery.py tests/unit/test_database.py tests/unit/export/test_jsonl.py
Copilot AI review requested due to automatic review settings October 22, 2025 17:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds persistence of autodiscovery telemetry to Postgres by creating a discovery_runs table and integrating persistence helpers into the CLI workflow. The changes enable recording of atlas env init telemetry and runtime executions when Postgres is configured, while also normalizing trajectory event exports with standardized event_type and actor fields.

Key Changes:

  • Added discovery_runs database table and log_discovery_run method for storing telemetry
  • Created CLI persistence helper that records discovery runs when database URL is configured
  • Normalized trajectory event export format with event_type and actor fields

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
atlas/runtime/storage/schema.sql Added discovery_runs table schema to store telemetry data
atlas/runtime/storage/database.py Implemented log_discovery_run method for persisting discovery runs
atlas/cli/persistence.py Created new helper module for best-effort persistence of discovery telemetry
atlas/cli/env.py Integrated persistence helper into env init command
atlas/cli/utils.py Added persistence of runtime execution telemetry
atlas/cli/jsonl_writer.py Normalized trajectory event format with event_type and actor fields
tests/unit/test_database.py Added test coverage for discovery run logging
tests/test_env_discovery.py Added test for persistence integration in env init
tests/unit/export/test_jsonl.py Updated tests for normalized trajectory event format

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread atlas/cli/jsonl_writer.py
Introduces a new learning evaluation workflow that does not require experience hints. Adds `atlas/evaluation/learning_report.py` for generating learning summaries, `scripts/eval_learning.py` for report generation, and updates documentation to describe the workflow. Extends database access methods for learning keys, sessions, and discovery runs. Updates JSONL exporter and session insights to include `execution_mode`. Adds comprehensive unit tests for new functionality.
@jbarnes850 jbarnes850 self-assigned this Oct 22, 2025
@jbarnes850 jbarnes850 added the enhancement New feature or request label Oct 22, 2025
@jbarnes850 jbarnes850 merged commit 8c6b379 into main Oct 22, 2025
1 check passed
@jbarnes850 jbarnes850 deleted the feature/issue-71-telemetry branch October 22, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

2 participants