Repository navigation
MAINT: Simplify scenario resume around stored planned seed groups (seed 3) #4366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Richard Lundeen (richlundeen)
wants to merge
6
commits into
microsoft:main
Choose a base branch
from
richlundeen:simplify-resume
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+959
−412
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6f5cebe
FEAT: Explain how to recover when a resumed run's datasets changed
richlundeen bd6e051
FEAT: Resume scenario runs from their stored planned seed groups
richlundeen b184270
MAINT: Drop resume-only population matching now that runs store their…
richlundeen 985d8a6
FEAT: Keep dataset media that an incomplete scenario run planned
richlundeen 408b4b8
MAINT: Simplify scenario resume around stored planned seed groups
richlundeen ab18e63
Merge main into simplify-resume
richlundeen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
56 changes: 56 additions & 0 deletions
56
pyrit/memory/alembic/versions/c7d1e9a3b5f2_add_scenario_plan_seed_groups.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT license. | ||
|
|
||
| """ | ||
| add scenario plan seed groups. | ||
|
|
||
| Revision ID: c7d1e9a3b5f2 | ||
| Revises: a3f7c9e2b641 | ||
| Create Date: 2026-11-16 15:30:00.000000 | ||
| """ | ||
|
|
||
| from collections.abc import Sequence | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| import pyrit.memory.memory_models | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision: str = "c7d1e9a3b5f2" | ||
| down_revision: str | None = "a3f7c9e2b641" | ||
| branch_labels: str | Sequence[str] | None = None | ||
| depends_on: str | Sequence[str] | None = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| """Store the seed groups each new scenario run planned, so resume doesn't read datasets.""" | ||
| op.create_table( | ||
| "ScenarioPlanSeedGroupEntries", | ||
| sa.Column("id", pyrit.memory.memory_models.CustomUUID(), nullable=False), | ||
| sa.Column("scenario_result_id", pyrit.memory.memory_models.CustomUUID(), nullable=False), | ||
| sa.Column("dataset_name", sa.Unicode(), nullable=False), | ||
| sa.Column("position", sa.INTEGER(), nullable=False), | ||
| sa.Column("seed_group", sa.JSON(), nullable=False), | ||
| sa.Column("has_media", sa.Boolean(), nullable=False), | ||
| sa.ForeignKeyConstraint(["scenario_result_id"], ["ScenarioResultEntries.id"], ondelete="CASCADE"), | ||
| sa.PrimaryKeyConstraint("id"), | ||
| ) | ||
| op.create_index( | ||
| "ix_ScenarioPlanSeedGroupEntries_scenario_result_id_position", | ||
| "ScenarioPlanSeedGroupEntries", | ||
| ["scenario_result_id", "position"], | ||
| unique=False, | ||
| ) | ||
| op.create_index( | ||
| "ix_ScenarioPlanSeedGroupEntries_has_media", "ScenarioPlanSeedGroupEntries", ["has_media"], unique=False | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| """Drop stored plan seed groups; runs planned after the upgrade can no longer resume.""" | ||
| op.drop_index("ix_ScenarioPlanSeedGroupEntries_has_media", table_name="ScenarioPlanSeedGroupEntries") | ||
| op.drop_index( | ||
| "ix_ScenarioPlanSeedGroupEntries_scenario_result_id_position", table_name="ScenarioPlanSeedGroupEntries" | ||
| ) | ||
| op.drop_table("ScenarioPlanSeedGroupEntries") |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the resume sentence about the resolver hook
The text says resume never calls
_resolve_seed_groups_by_dataset_async. Only the base skips it.PackageHallucinationcalls it on every resume, and three scenarios call it for older runs. Say the base never calls it. Also update the old resume text in the resolver docstrings.