Skip to content

Pin the Harness at ee89d088, pass a run its services by value, and take its events as values - #34

Merged
vinniefalco merged 3 commits into
cppalliance:masterfrom
vinniefalco:master
Nov 22, 2026
Merged

vinniefalco merged 3 commits into
cppalliance:masterfrom
vinniefalco:master

Conversation

@vinniefalco

@vinniefalco vinniefalco commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Workshop builds the setup of each run without Arc::new, and its recorder tee takes each event of a run as a value. Both come with the Harness at ee89d088, the head of cppalliance/runvil-harness#62: RunSetup::new takes a service itself, and a recorder is handed each event with its record. The pin moves first, in a commit of its own, with Workshop's code as it is. So that commit shows that Workshop as written builds and passes on the new Harness.

Merge order: this pull request merges after cppalliance/runvil-harness#62. Its pin names a commit that only that pull request holds until then. The Harness merge is a fast-forward, so the commit keeps its id.

The commits

  • Pin the Harness at ee89d088. The three rev values of runvil-harness in Cargo.toml move, with the lock file, and no code changes.
  • Pass each service of a run itself to RunSetup::new. setup_for loses its three Arc::new, and Conversation::recorder takes its inner recorder in each form in which a setup takes one.
  • Take each event of a run as a value in the recorder tee. The tee overrides append_event, and its parse of the record of each event goes.

Each of the three passes Workshop's whole verification list by itself. Each commit message ends with a Plan: line that names the plan file in runvil-harness.

What changes

setup_for, before:

let recorder = conversation.recorder(Arc::new(
    self.inner.recorder.for_agent(conversation.agent()),
));
let broker = Arc::new(RunBroker::new(
    self.inner.broker.clone(),
    conversation.clone(),
));
RunSetup::new(recorder, broker, Arc::new(TokioTimer))
    .vfs(language_guide::run_vfs())
    .has_user(true)

After:

let recorder = conversation.recorder(self.inner.recorder.for_agent(conversation.agent()));
let broker = RunBroker::new(self.inner.broker.clone(), conversation.clone());
RunSetup::new(recorder, broker, TokioTimer)
    .vfs(language_guide::run_vfs())
    .has_user(true)

The tee, before:

fn append(&self, run: RunId, record: Record) -> BoxFuture<'_, Result<(), Error>> {
    Box::pin(async move {
        let event = (record.kind == RecordKind::Event).then(|| record.payload.clone());
        self.inner.append(run, record).await?;
        if let Some(payload) = event {
            match serde_json::from_value::<Event>(payload) {
                Ok(event) => self.conversation.observe(&event),
                Err(error) => tracing::error!(/* the transcript skips it */),
            }
        }
        Ok(())
    })
}

After:

fn append(&self, run: RunId, record: Record) -> BoxFuture<'_, Result<(), Error>> {
    self.inner.append(run, record)
}

fn append_event<'a>(
    &'a self,
    run: RunId,
    record: Record,
    event: &'a Event,
) -> BoxFuture<'a, Result<(), Error>> {
    Box::pin(async move {
        self.inner.append_event(run, record, event).await?;
        self.conversation.observe(event);
        Ok(())
    })
}
  • Conversation::recorder takes inner: impl IntoShared<dyn RunRecorder>, where it took an Arc<dyn RunRecorder>. A caller passes the recorder itself, an Arc of it, or an Arc<dyn RunRecorder>.
  • For an event, the Harness calls append_event with the record and the event. The tee hands both to the inner recorder, and once that recorder has accepted the record, it hands the event to the conversation.
  • The order is as it was. The record is stored first, and a refused write is returned as the inner recorder's own, so its event reaches no one.
  • The error branch for a recorded event that fails to parse goes with the parse.
  • Cargo.lock changes its 14 source lines of the Harness packages and nothing else.
  • The new pin brings in nine Harness commits: the six of Let RunSetup::new take a service in any form, and hand the recorder each event runvil-harness#62, and three that master of the Harness held already, which change text only.

What a person will notice

The window, the transcript, and the run log get the same events in the same order as before.

Call sites

  • setup_for is three statements, and its three Arc::new are gone.
  • Seven arguments of RunSetup::new in three test files are plain values, and one of those files lost its import of Arc.
  • The four callers of Conversation::recorder pass a recorder by value once and an Arc three times.

Tests

The two test groups run 706 and 354 tests on Windows, all passing, after each of the three commits. Those are the counts of before.

  • The pin alone. Workshop's code is as it was in the first commit, so its whole suite is the test that Workshop as written runs on the new Harness.
  • The tee. Its five tests keep their assertions. The three that feed events hand the tee the record and the event through append_event. The inner recorder of those tests overrides append alone, so the test of the order still shows that the transcript was empty while the inner recorder took the record.
  • The diff adds no test. A run of Workshop does what it did.

Checks

Every command in AGENTS.md passed on the new pin before each of the three commits, with --locked: the format check, clippy in its two groups with CARGO_BUILD_WARNINGS=deny, nextest in its two groups, the docs build with RUSTDOCFLAGS="-D warnings", cargo dylint, the structural checks, and the wording scan. The pre-push hook passed on the push.

The checks ran on Windows.

Summary by CodeRabbit

  • Bug Fixes
    • Conversation transcripts now receive events after those events are successfully recorded, preventing event records from being silently omitted when their contents cannot be decoded.
  • Improvements
    • Recorder setup now accepts recorder and run-service values directly, making configuration more flexible without changing the resulting behavior.

The three `rev` values of the root `Cargo.toml` name `ee89d088`. That commit of the Harness lets the setup of a run take a service in any of three forms, warns about a run report that is dropped unread, and hands a recorder each event with its record. Workshop's code is as it was, and it builds and passes its tests on the new commit.

- `Cargo.lock` changes the 14 `source` lines of the crates that come from `runvil-harness`. It adds no crate and removes none.
- The pin moves across nine commits of `runvil-harness`.
- The diff changes no code and no test.

Plan: runvil-harness/plan/2026-11-21-2-run-services-and-event-values.plan.md
`RunSetup::new` of the Harness takes a service itself and puts it into an `Arc`, so `setup_for` passes its `RunBroker` and `TokioTimer` directly. `recorder` of `Conversation` takes its inner recorder as `impl IntoShared<dyn RunRecorder>`, the forms that `RunSetup::new` takes, so `setup_for` hands it the recorder of the agent by value. The three `Arc::new` of `setup_for` are gone.

- A caller of `recorder` passes the recorder itself, an `Arc` of it, or an `Arc<dyn RunRecorder>`. `recorder` calls `into_shared` on what it is given.
- Seven arguments of `RunSetup::new` in three test files lose their `Arc::new`, and `bindings-tests.rs` loses `use std::sync::Arc;`.
- No assertion changes, and the diff adds no test.

Plan: runvil-harness/plan/2026-11-21-2-run-services-and-event-values.plan.md
The Harness hands a recorder each event with its record, through `append_event`. The tee overrides that method: it passes the record and the event on to the inner recorder, and once that recorder has accepted the record, it hands the event to the conversation. So the tee stops copying the payload of each record and parsing the event back out of it, and the error branch for a payload that fails to parse goes.

- `append` passes each record on to the inner recorder as it is.
- The order is as it was: the inner recorder takes the record first, and its refusal is returned as its own, so a refused event reaches no one.
- The three tests that feed events call `append_event` with the record and the event. `Watching`, the inner recorder of the tests, leaves `append_event` at its default, so the record of an event reaches its `append`, and the test of the order still finds the transcript empty at that moment.
- `tee.rs` loses its import of `RecordKind`.
- No assertion changes, and the diff adds no test.

Plan: runvil-harness/plan/2026-11-21-2-run-services-and-event-values.plan.md
Copilot AI balanced review requested due to automatic review settings November 22, 2026 02:14

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The PR updates three Harness dependency pins. Conversation::recorder accepts values convertible to shared recorder ownership. ConversationRecorder forwards supplied events and records to the inner recorder. Run setup callers pass values directly instead of wrapping them in Arc.

Changes: Harness API updates

Layer / File(s) Summary
Harness pin and recorder input
Cargo.toml, crates/workshop/agents/src/conversation-run.rs
The three Harness dependency pins move to commit ee89d0882ec8cecfcd0159c7f61c6741fceef612. Conversation::recorder accepts any IntoShared<dyn RunRecorder> input and converts it before constructing the recorder.
Recorder event forwarding
crates/workshop/agents/src/tee.rs, crates/workshop/agents/src/tee-tests.rs
append delegates to the inner recorder. append_event forwards the record and event, then observes the event in the conversation after a successful write. Tests pass both values to append_event.
Run setup callers
crates/workshop/agents/tests/it/support.rs, crates/workshop/server/src/agents.rs, crates/workshop/server/src/agents/...
Run setup callers pass recorder, broker, and timer values directly to RunSetup::new instead of wrapping them in Arc.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Merge Risk: Minimal · up to f40a4

This change updates the Harness dependency and adapts how Workshop passes run services and recorder events. No concrete defect was found, and the reported tests pass. It is low risk to merge, provided the Harness pin lands as described.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names three changes: pinning the Harness to commit ee89d088, passing run services by value to RunSetup::new, and taking recorder events by value through append_event. The raw summary confirm…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names three changes: pinning the Harness to commit ee89d088, passing run services by value to RunSetup::new, and taking recorder events by value through append_event. The raw summary confirms all three: the Cargo.toml pin change, the removal of Arc wrappers in RunSetup::new calls, and the tee's move to append_event. The title is specific and accurate, though it lists three changes and is somewhat long at 94 characters.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: b52e5b3d-243c-408c-832c-ea0af8559f24
Commits

Reviewing files that changed from the base of the PR and between 73e4fcc and f40a4fc.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 8

  • Cargo.toml
  • crates/workshop/agents/src/conversation-run.rs
  • crates/workshop/agents/src/tee-tests.rs
  • crates/workshop/agents/src/tee.rs
  • crates/workshop/agents/tests/it/support.rs
  • crates/workshop/server/src/agents.rs
  • crates/workshop/server/src/agents/bindings-tests.rs
  • crates/workshop/server/src/agents/tests.rs

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The unavailable implementation of cppalliance/runvil-harness#62 leaves the event-dispatch, default/Arc-forwarding, and IntoShared/append_event contracts at ee89d088 unverified, along with upstream merge status and required merge order.

No open issues 🎉

What changed in this PR

Updates Workshop to Harness commit ee89d088, simplifying run setup and consuming typed events directly instead of decoding their recorded JSON. This PR depends on cppalliance/runvil-harness#62 merging first.

Changes:

  • Updates all three Harness dependency pins and 14 lockfile source entries.
  • Passes run services directly and lets Conversation::recorder accept owned or shared recorders.
  • Routes typed events through append_event, preserving record-before-observation ordering and adapting existing tests.
File Description
crates/​workshop/​server/​src/​agents/​tests.rs Passes broker and timer values directly in tests.
crates/​workshop/​server/​src/​agents/​bindings-tests.rs Simplifies test setup and removes the unused Arc import.
crates/​workshop/​server/​src/​agents.rs Removes explicit service wrapping from production run setup.
crates/​workshop/​agents/​tests/​it/​support.rs Updates integration-test setup to pass services directly.
crates/​workshop/​agents/​src/​tee.rs Forwards typed events after successful recording, removing JSON parsing.
crates/​workshop/​agents/​src/​tee-tests.rs Exercises append_event with existing ordering and failure assertions.
crates/​workshop/​agents/​src/​conversation-run.rs Accepts owned or shared recorders through IntoShared.
Cargo.toml Pins all three Harness dependencies to the new commit.
Cargo.lock Aligns 14 Harness package sources with the new pin.

Review effort: Balanced

@vinniefalco
vinniefalco merged commit f40a4fc into cppalliance:master Nov 22, 2026
17 checks passed
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.

2 participants