Skip to content

Promote successful attempts so 7.6 can measure anything - #196

Merged
joslat merged 1 commit into
mainfrom
feat/procedure-promotion
Aug 13, 2026
Merged

joslat merged 1 commit into
mainfrom
feat/procedure-promotion

Conversation

@joslat

@joslat joslat commented Aug 13, 2026

Copy link
Copy Markdown
Owner

The prerequisite found while preparing the run: the MAF provider recalls reasoning traces and never writes one. The procedural arm would have recalled procedures while nothing stored any — both arms identical, harness reporting "no benefit" while describing a wiring gap.

MafAgentTaskRunner now promotes a completed attempt to a stored procedure. The three ways that could quietly reopen are each pinned by a test:

  • Successful attempts only. Promoting a failure teaches the wrong chain; 7.7's wrong-procedure rate would correctly punish it, and the benchmark would be measuring a bug introduced here rather than the feature.
  • TraceKind.Procedure, never Episode. Owner-scoped procedural recall filters on procedures, so an episode-kinded trace is stored, recalled by nothing, and presents as the same false negative.
  • Promotion is the arm switch. The control arm is constructed without a repository and never promotes. If both promoted, they'd share a procedure store and the comparison would measure nothing.

Tests assert the promotion decision directly rather than driving a stub agent — the decision is what can be quietly wrong, and routing through an agent would test the plumbing around it while dragging Agent Framework types into a test project with no reason to reference them.

4,370 unit and 449 LongMemEval green (+6). What remains for 7.6 is the measured run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PgDgctPpbTziBNE2RT8VdE

The prerequisite found while preparing the run: the Agent Framework
provider recalls reasoning traces and never writes one, so the
procedural arm would have recalled procedures while nothing stored any.
Both arms would have behaved identically and the harness would have
reported "no benefit" while describing a wiring gap.

MafAgentTaskRunner now promotes a completed attempt to a stored
procedure, and the three ways that could quietly reopen are each pinned
by a test.

Successful attempts only. Promoting a failure teaches the wrong chain;
7.7's wrong-procedure rate would then correctly punish it, and the
benchmark would be measuring a bug introduced here rather than the
feature.

Written as TraceKind.Procedure, never Episode. Owner-scoped procedural
recall filters on procedures, so an episode-kinded trace is stored,
recalled by nothing, and presents as exactly the same false negative.

Promotion is the arm switch: the control arm is constructed without a
repository and therefore never promotes. If both arms promoted they
would share a procedure store and the comparison would measure nothing.

The tests assert the promotion decision directly rather than driving a
stub agent. The decision is the part that can be quietly wrong; routing
through an agent would have tested the plumbing around it, and it also
kept the Agent Framework types out of a test project that has no reason
to reference them.

4,370 unit and 449 LongMemEval tests green (+6). What remains for 7.6 is
the measured run itself.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PgDgctPpbTziBNE2RT8VdE
Copilot AI lite review requested due to automatic review settings August 13, 2026 02:26

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.

Pull request overview

Adds procedure-promotion to the LongMemEval MAF runner so repeated-attempt benchmarks can actually persist a successful tool chain as a reusable procedure and measure procedural-memory benefit.

Changes:

  • Extend MafAgentTaskRunner with optional IReasoningTraceRepository + owner id and promote successful runs to TraceKind.Procedure.
  • Persist a promoted trace containing the invoked tool chain (as Outcome) after each completed attempt when procedural memory is enabled.
  • Add unit tests that pin the promotion decision (success-only, procedure kind, control arm doesn’t promote, chain is recorded).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tools/AgentMemory.LongMemEval/MafAgentTaskRunner.cs Promotes completed attempts into stored procedures via IReasoningTraceRepository.
tests/AgentMemory.Tests.Unit.LongMemEval/MafAgentTaskRunnerTests.cs Adds unit coverage for the promotion decision and stored trace shape.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +145 to +157
await _traces.AddAsync(
new ReasoningTrace
{
TraceId = $"proc-{Guid.NewGuid():N}",
SessionId = "procedural-benchmark",
Task = _taskPrompt,
Outcome = chain,
Success = true,
Kind = TraceKind.Procedure,
OwnerId = _ownerId,
StartedAtUtc = DateTimeOffset.UtcNow,
CompletedAtUtc = DateTimeOffset.UtcNow,
},
Comment on lines +145 to +158
await _traces.AddAsync(
new ReasoningTrace
{
TraceId = $"proc-{Guid.NewGuid():N}",
SessionId = "procedural-benchmark",
Task = _taskPrompt,
Outcome = chain,
Success = true,
Kind = TraceKind.Procedure,
OwnerId = _ownerId,
StartedAtUtc = DateTimeOffset.UtcNow,
CompletedAtUtc = DateTimeOffset.UtcNow,
},
cancellationToken).ConfigureAwait(false);
Comment on lines +203 to +211
public async Task TheProcedureRecordsTheToolChain()
{
// What makes it reusable rather than a note that something worked once.
var (repo, added) = Traces();

await PromoteAsync(repo, completed: true, enabled: true);

added.Single().Outcome.Should().Be("LookUpTraveller -> PlaceHold -> Book");
}
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