Skip to content

Add trajectory reviewer - #80

Merged
simonpcouch merged 42 commits into
mainfrom
view-trajectories-53
Aug 5, 2026
Merged

Add trajectory reviewer#80
simonpcouch merged 42 commits into
mainfrom
view-trajectories-53

Conversation

@skaltman

@skaltman skaltman commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Adds a trajectory reviewer app.

Launch the reviewer app with:

# launches reviewer for tlg agent trajectories
trajectory_review(read_trajectories("04ee623c-3daf-4893-989e-7be4f2c0e7a7"))

Trust tags are reconstructed from the conversation, see #79.

Notes and flags are written to an append-only JSONL file. There is probably later work to do on how the review data is stored. You can join the review data back to the trajectories data for analysis:

trajectories <- read_trajectories("04ee623c-3daf-4893-989e-7be4f2c0e7a7")
trajectory_reviews_read("commons-review.jsonl", trajectories)
image

Addresses #53

skaltman added 28 commits August 3, 2026 11:24
- `view_trajectories()` → `trajectory_review()`
- `read_trajectory_reviews()` → `trajectory_reviews_read()`
- Update documentation and examples accordingly
@skaltman
skaltman requested a review from simonpcouch August 4, 2026 00:57

@simonpcouch simonpcouch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Super excited about this! Some initial thoughts here.

Comment thread R/trajectory-review-log.R Outdated
#' @return A list of actionable review records in file order: all notes and
#' currently active flags. When `trajectories` is supplied, each record also
#' contains `turns`.
#' @export

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Part of me wonders whether we ought to write the reviews with the turns 'joined' in in the first place. Since it's a human that reviews the responses, I would guess that the scale of these wouldn't reach past 100s of comments, so these files wouldn't ultimately end up huge.

The reason I say this is because I would suspect that humans would not be the ones to then go and read in all of the reviews + process them, so I'd prefer we not export a function mostly for the coding agent's usage. Instead, that format that contains both the turns and the reviews could be document with a few-liner in the trajectory_review() docs that gets the agent most of the way there.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Garrick thinks we should probably have a function like this. He also suggested maybe this ends up being a directory of markdown files so that they're super agent-readable (whether that's immediately what they become or get post-processed into after this intermediate state)

@skaltman skaltman Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I like Garrick's idea, and I think regardless of format, the review writing and ingesting process needs a second look. For now:

  • I removed trajectory_reviews_read() for the reason you stated, and because the trajectory review format may change. It's not needed to read in the trajectories, so this doesn't result in any loss of functionality.
  • I did not change the review jsonl format to include the turns because the format may change and I am also a bit hesitant to duplicate that data (but could definitely be convinced that this isn't a problem).
  • I can plan to revisit the review log format for v2.

How does that sound?

Comment thread R/trajectory-timeline.R Outdated
Comment thread R/trajectory-read.R
Comment thread inst/www/commons-viewer/commons-viewer.css Outdated
Comment thread R/trajectory-review.R Outdated
Comment thread R/trajectory-review.R
@simonpcouch simonpcouch linked an issue Aug 4, 2026 that may be closed by this pull request
@simonpcouch

simonpcouch commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Feedback from Paul & Garrick:

  • Trajectory is good, no need to rename
  • Trust level might need some interface other than a selector
  • The Conversation vs. Question picker is confusing. What does it mean to be in one tab or another?
  • Should the timeline plot instead be a series of stacked bars?
  • Maybe the conversation view should be full-height and then the plot becomes the top of the sidebar that the "Notes for Question n" currently lives in
  • Should there be a way to remove / edit existing notes?

@skaltman

skaltman commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

@simonpcouch thank you!

  • Did another pass over the comments to make them less verbose and only present when necessary.
  • Removed trajectory_reviews_read(): Add trajectory reviewer #80 (comment)
  • Simplified the notes panel, note text area input, and date picker using built-in shiny/bslib functions (bslib::layout_sidebar, bslib::input_submit_textarea, shiny::dateRangeInput)
  • The timeline now uses stacked bars for sparse data. Binning dates in a stacked area chart was confusing because an area chart implies a continuous x-axis.
  • Another simplification: The trajectory reviewer now passes saved messages directly to shinychat when
    creating the chat, instead of creating an empty chat and replaying each message.

I think we can defer the changes that came out of the feedback from Paul and Garrick to a follow up PR. Specifically, I think it's worth revisiting how review data is stored and possibly using markdown like Garrick suggested.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Preview deployed to Connect (dogfood.team.pct.posit.it): https://dogfood.team.pct.posit.it/connect/#/apps/d7a36cae-8f27-448b-a478-61b81fbe3942/draft/358570

Deployed from commit 3b524d1.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Preview deployed to Connect (connect.staging.pct.posit.it): https://connect.staging.pct.posit.it/connect/#/apps/ad662e1b-5048-4acc-9ad7-f9478c92274e/draft/1659

Deployed from commit 3b524d1.

@simonpcouch simonpcouch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great, thanks so much! Agreed that we can iterate on the review reading and other UI points after merge.

In addition to merging upstream, I went ahead and did the read_trajectories() -> trajectory_read() rename, so the function names are consistent, and added you as author.

@simonpcouch
simonpcouch merged commit 03dcd84 into main Aug 5, 2026
2 checks passed
@simonpcouch
simonpcouch deleted the view-trajectories-53 branch August 5, 2026 16:28
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Cleaned up 2 preview bundle(s) on https://dogfood.team.pct.posit.it: 358569, 358570

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Cleaned up 1 preview bundle(s) on https://connect.staging.pct.posit.it: 1658

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.

Viewing trajectories

2 participants