Repository navigation
fix(core): give default seed candidates a per-run id (#163) - #164
Open
RupeshMaster wants to merge 1 commit into
Open
RupeshMaster wants to merge 1 commit into
RupeshMaster wants to merge 1 commit into
Conversation
default_policy_seeds() ids are a hash of the seed text, so they are the same for every campaign over the same policy. Hosted keys candidates (and traces) by candidate id alone, and its upsert keeps the original campaign_id, so from the second campaign on: - the campaign page listed none of its seed candidates (with stop_on_first_violation the page said "Break found" with nothing to inspect, minimize or save) - the first campaign's candidate row and trace were overwritten with the later run's evidence This happened for a repeated Hosted demo run and for `mutiny run --hosted` run twice on one project. The engine now suffixes default seed ids with a per-run token (seed-0-<hash>-<run>). Explicitly passed seeds keep their ids, and default_policy_seeds() itself is unchanged.
|
@RupeshMaster is attempting to deploy a commit to the priyanshu's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Fixes #163. From the second campaign over the same policy onward, Hosted listed none of the campaign's seed candidates and overwrote the first campaign's candidate rows and traces, because default seed ids are a hash of the seed text and Hosted keys candidates by id alone.
CampaignEnginenow suffixes default seed ids with a per-run token:seed-0-a792b2c8becomesseed-0-a792b2c8-<run>. Padded copies and children are unaffected (children already use UUIDs).seeds=keep their ids, anddefault_policy_seeds()itself is unchanged (still deterministic per policy).mutiny run --hostedingest.Not in this PR
The Hosted schema still keys
candidates/tracesby candidate id alone, andupsert_candidateupdates a row owned by another campaign. After this change the CLI and the demo no longer produce duplicate ids, but a client that sends them (for example an older CLI) can still collide. A(campaign_id, id)key or a conflict check on ingest would close that; it needs a migration, so I left it for a separate change if you want it.Type of change
Checklist
Fixes #N) or Discussion when applicableuv run pytest tests/unit -q)Test plan
uv run --locked ruff check→ all checks passeduv run pytest tests/unit tests/integration tests/reliability -q→ 851 passed. Run locally on Python 3.12 only (macOS,OPENAI_API_KEYunset); 3.11 is left for CI.examples/openai_support_agent,mutiny --help,mutiny init,mutiny runwithMUTINY_SAMPLE_OFFLINE=1and emptyOPENAI_API_KEY/FEATHERLESS_API_KEY→ violation found, regression saved.apps/webis not touched.tests/unit/test_package_release.pypassed as part of the unit run;./scripts/verify_release_artifacts.shnot run.Extra:
tests/unit/test_campaign.py(ids unique per run, explicit seeds kept) and one intests/integration/test_api.py(two demo campaigns each keep their own candidates and traces). The first unit test and the integration test fail onmain(ee7e898).mutiny run --hostedruns of the sample project now each list their own candidate (seed-0-a792b2c8-d068b5be,…-77b6aaa1,…-62c7ad66,…-96f691ac). Onmainonly the first of the four listed any.Notes