salesforce / salesforce/evalon

Deduplicate evaluated-participant lookup into a single source of truth

Open Beginner friendly
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Scala
Stars
0
Forks
3
Avg merge
1d 21h
Merged PRs (30d)
2

Description

Summary

The "find the evaluated participant" lookup is implemented independently in two places:

  • EvalonRunner.evaluatedName (EvalonRunner.scala:111-115)
  • inline in ScenarioRunner.apply (ScenarioRunner.scala:88-91)

Both are byte-identical today (scenario.participants.find(_._2.participantType == ParticipantType.Evaluated).map(_._1).getOrElse("agent")), so they must be kept in sync by hand.

Why it matters

This is more than a DRY nit because the two copies feed different things:

  • ScenarioRunner's copy names the actor that is spawned as the evaluated agent.
  • EvalonRunner's copy is what failure classification compares against (EvalonRunner.scala:87) to decide AgentStepFailedException vs SimulationFailedException.

If one is edited (e.g. changing the .getOrElse("agent") fallback or adding a tie-break) and the other is missed, the actor spawned as "the evaluated agent" and the name used for classification diverge, silently misclassifying every agent failure as a harness failure.

Suggested fix

Extract one shared helper and have both call sites use it, so the evaluated-participant identity has a single source of truth.

Priority: low (no current bug; latent divergence risk). Found during review of #8. See also #9 (related classification correctness).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with EvalonRunner.scala:87 and 111-115, then compare the duplicate lookup in ScenarioRunner.scala:88-91. Extract the shared evaluated-participant lookup and update both call sites to use it. Done means both spawning and failure classification use the same source of truth, with existing tests still passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.