[REFACTOR]: Add shared linear trace runner - #148
Open
Spencer Schoenberg (spencrr) wants to merge 3 commits into
Open
Spencer Schoenberg (spencrr) wants to merge 3 commits into
Spencer Schoenberg (spencrr) wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
3 tasks done
Spencer Schoenberg (spencrr)
force-pushed
the
dev/spencrr/trace-runner
branch
from
August 8, 2026 02:31
f1850d4 to
23d19a2
Compare
Spencer Schoenberg (spencrr)
force-pushed
the
dev/spencrr/trace-runner
branch
2 times, most recently
from
August 27, 2026 17:30
a085b65 to
cd2667c
Compare
Spencer Schoenberg (spencrr)
force-pushed
the
dev/spencrr/trace-runner
branch
2 times, most recently
from
September 8, 2026 22:46
c6e22c8 to
1fd45e0
Compare
Spencer Schoenberg (spencrr)
force-pushed
the
dev/spencrr/trace-runner
branch
3 times, most recently
from
September 29, 2026 22:20
560cb32 to
9faf7bc
Compare
Require the same observability and manifest before reusing an online judgment. Copy optional evidence through the shared tolerant renderer so malformed supporting text cannot discard an established verdict. Keep terminal evidence and operand lists independent from online records.
Rename evaluate_terminal_async to evaluate_final_trace_async so the public runner helper matches Result.final_trace_evaluation. Document the trace execution helpers where they are introduced.
Spencer Schoenberg (spencrr)
force-pushed
the
dev/spencrr/trace-runner
branch
from
October 1, 2026 00:59
9faf7bc to
ad0951d
Compare
Spencer Schoenberg (spencrr)
marked this pull request as ready for review
October 1, 2026 05:16
Spencer Schoenberg (spencrr)
requested review from
a team
and
a balanced review from Copilot
October 1, 2026 05:16
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Spencer Schoenberg (spencrr)
October 1, 2026 05:17
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the documented contract and has thorough focused test coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds a shared linear trace runner for future attack and probe strategies, including final-trace evaluation reuse.
Changes:
- Adds trace execution, termination tracking, and final evaluation helpers.
- Exports and documents the new core APIs.
- Adds comprehensive unit coverage for stopping, histories, reuse, mutation, and budgets.
| File | Description |
|---|---|
rampart/core/trace.py |
Implements shared trace execution and evaluation reuse. |
rampart/core/__init__.py |
Exports the new public APIs. |
docs/api/core-protocols.md |
Adds API reference entries. |
tests/unit/core/test_trace.py |
Tests trace execution and reuse behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
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.
Description
Adds the linear trace runner shared by attack and probe strategies.
run_trace_asyncdrives a conversation with an optional onlinestop_whencheck, keeps separate raw and annotated turn histories, and recordsTraceEndReason.evaluate_final_trace_asyncevaluates the final trace once. It reuses the latest online evaluation only when the evaluator, raw turns, manifest, and observability level are all identical.The runner does not own session lifetime, polarity, cleanup, or exception conversion; those remain strategy and
BaseExecutionresponsibilities. Driver history receives a shallow copy, evaluator contexts contain annotation-free turns, and reused evaluator evidence is copied defensively.EvaluationRecord,TraceRun,run_trace_async, andevaluate_final_trace_asyncare exported fromrampart.corefor custom strategies and documented in the API reference. Built-in probes adopt them in #149 and XPIA in #150.Breaking changes
None. This PR adds APIs and does not change existing strategies.
Checklist
pre-commit run --all-filespasses