feat: add privacy-safe raw control, integration tests, and docs for trajectory detail page - #430
Open
Hpward-Ling wants to merge 2 commits into
Open
feat: add privacy-safe raw control, integration tests, and docs for trajectory detail page#430Hpward-Ling wants to merge 2 commits into
Hpward-Ling wants to merge 2 commits into
Conversation
added 2 commits
July 30, 2026 14:40
…rajectory detail - trajectory_detail() now defaults to omitting the raw sample dict; pass include_raw=True (or ?include_raw=true query param) to attach it - HTTP route parses include_raw query parameter for the /api/jobs/<id>/trajectory endpoint - Add TestTrajectoryDetailIntegration covering job/sample resolution, error paths, include_raw behavior, and large-trace robustness (7 new tests) - Add 'Dashboard trajectory detail page' section to docs/cli/observability.rst with API reference, response field table, and curl example Closes inclusionAI#267
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Resolves #267.
The agentic trajectory detail page needs a privacy-safe default for raw sample exposure, integration test coverage for the trajectory detail endpoint, and user-facing documentation.
What this PR does
1. Privacy-safe raw sample control (
areno/dashboard/server.py)trajectory_detail()now acceptsinclude_raw: bool = Falsekeyword argumentinclude_raw=Trueor query param?include_raw=trueto explicitly request the raw sample under therawkeybuild_trajectory_detaildocstring to reflect that raw is not included by defaultSafe default: existing behavior of listing trajectory events, token counts, training mask summary, and end reason is preserved. The only change is that the full raw sample (including token sequences and loss mask arrays) is no longer exposed unless explicitly requested.
2. Integration tests (
tests/test_dashboard_trajectory.py)Added
TestTrajectoryDetailIntegrationclass with 7 new test cases:test_resolves_sample_from_registered_job— success path: registered job → valid trajectory detailtest_job_not_found_returns_error— error path: nonexistent job_idtest_sample_not_found_returns_error— error path: valid job, nonexistent step/prompt/sample indicestest_raw_omitted_by_default— privacy default:rawkey absent withoutinclude_rawtest_raw_included_when_requested—include_raw=Trueattaches raw sampletest_non_agentic_sample_in_job_returns_invalid— non-agentic sample in a job returnsvalid: Falsetest_large_trace_does_not_crash— 50-turn tool call trace does not crashTests use a
_registered_jobfixture that directly manipulates the globalSTATE, requiring no HTTP server or external database.3. Documentation (
docs/cli/observability.rst)Added "Dashboard trajectory detail page" section covering:
curlexample with JSON responseTesting