Skip to content

Python 3.11 adoption opportunities: claim one improvement at a time #3166

Closed

Description

@romanlutz

Is your feature request related to a problem? Please describe.

PyRIT now requires Python >=3.11 (currently <3.15), and Ruff targets py311. We can use Python 3.11 features consistently across supported versions, simplify older compatibility patterns, and improve typing, diagnostics, and async lifecycle management. Some features are already partially adopted; the opportunities below are investigations, not instructions to replace every existing pattern.

Describe the solution you'd like

How to participate: ONE opportunity at a time

2026-11-20 restructuring: the remaining open items now live in dedicated issues — #4504 (P311-01, typing.Self), #4505 (P311-02, TypedDict), #4506 (P311-03, assert_never), #4507 (P311-11, gather cleanup), #4508 (P311-17, StrEnum), #4509 (P311-22, get_prompt_scores batching fix) — each with a maintainer-side scope assessment and candidate inventory. Claim and contribute on the dedicated issue (claim by comment first; the first commenter may open a PR). This tracker is the frozen historical record: the claim tables and deadlines below are no longer updated, and P311-07, P311-12, P311-23 and P311-24 are closed as no-change after maintainer-side sweeps (comments below).

Claim exactly ONE checklist item at a time by commenting on this issue thread with its ID (for example, P311-01) and a short description of what you intend to investigate. Do not start multiple items or claim a bundle. Wait for confirmation here before treating the item as reserved. Claims are processed in comment order, and this issue is checked approximately every three hours.

  • You must open a PR within five days (120 hours) of your claim comment. The table below records the due date. If no PR is opened by then, the claim expires, the item becomes available, and your issue assignment is removed if you have no other active contribution on this issue. You can claim it again if it is still available.
  • Opening a PR within the deadline retains your claim while that PR is active. You cannot claim another item until your current PR is merged or the current contribution is explicitly released/closed.
  • Link this issue and the item ID in your PR description. Keep the PR focused on that one opportunity. Follow repository instructions and add relevant behavior/type-checking coverage.
  • Investigate first. Preserve public contracts and intended behavior. If a feature is not a good fit, explain why on this thread rather than forcing a change. An investigation can conclude that no code change is appropriate.
  • A PR opened without a prior claim will be highlighted to Roman Lutz (@romanlutz). If the item is unclaimed, we can link the PR and assign the item to its author. If someone else has already claimed it or another PR overlaps, Roman Lutz (@romanlutz) will assess how to proceed; no existing claim will be displaced automatically.
  • Checkboxes mean completed, not claimed. Check an item only after its PR is merged, or after a maintainer explicitly accepts a no-change investigation. Ownership and PR links are tracked separately below.

Opportunity checklist

Typing

  • P311-01: Extend typing.Self adoption. Investigate older same-concrete-class factories and fluent APIs, such as pyrit/common/yaml_loadable.py:YamlLoadable.from_yaml_file. Replace bound-TypeVar boilerplate only where it really models Self; retain independent generic parameters. Merged scope: #3194 covers YAML/seed and scorer-metrics loaders, strategy-context copying, and technique collections, with type-regression coverage. Additional merged scope: #3201 covers the three Message factories and AtomicAttackIdentifier.build, including subclass type-regression tests. Additional merged scope: #3266 covers SeedDataset.from_dict, MessageScorable.from_message, and ContentScorable.from_message, with subclass runtime and assert_type coverage and unchanged validation. Additional merged scope: #3383 covers AttackTechniqueSeedGroup.from_system_prompt and from_messages, with unchanged cls construction/validation and subclass runtime/assert_type coverage. Additional merged scope: #3411 covers MessagePiece.adversarial_placeholder with unchanged cls construction and subclass runtime/assert_type coverage. Additional merged scope: #3470 covers TagQuery.all, any_of, and none_of, with subclass runtime/assert_type coverage and unchanged predicates/validation. Additional merged scope: #3520 covers ScenarioRunSizeEstimate.unavailable, preserving cls construction, unavailable status, defaults, dataset/limit handling and validation, with subclass runtime/assert_type and input/default coverage. Additional merged scope: #3529 covers HarmDefinition.from_yaml, with subclass runtime/assert_type coverage and unchanged YAML loading, path resolution, field conversion, source-path recording and validation. Additional merged scope: #3577 annotates JsonResponseConfig.from_metadata with Self and adds subclass runtime/assert_type coverage; the factory runtime body, schema parsing, defaults, validation and metadata round trips are unchanged. Additional merged scope: #3626 annotates WebSearchConfig.from_metadata with Self, with subclass runtime/assert_type coverage of absent and explicit policies. Construction, read-only Mapping inputs, default/disabled/required modes, frozen/extra-forbid validation, errors, non-mutation and metadata/JSON round trips are unchanged. Additional merged scope: #3779 annotates AdversarialPrompts.from_metadata with Self | None and adds base/subclass runtime and assert_type checks, absent-association cases, read-only mapping, non-mutation, JSON round-trip and validation coverage. The factory body and seed semantics are unchanged. Additional merged scope: #3823 annotates AttackResultMetadata.from_metadata with Self and adds subclass runtime/assert_type coverage. Its factory body, defaults, unknown-role fallback, invalid-position handling and parent-linkage separation are unchanged. Additional merged scope: #3884 annotates TokenUsage.from_metadata with Self | None and checks subclass construction and static optional narrowing. Its factory body, absent-metadata None, counter filtering, extra counters and metadata round trips are unchanged. Additional merged scope: #3897 annotates RequestTraceContext.from_metadata with Self | None and checks subclass construction, optional narrowing, absent metadata and input non-mutation. Its runtime factory body, trace validation and metadata semantics are unchanged. Further merged contribution: #3992 completes subclass-preserving Self | None typing for ToolExecutionMetadata.from_metadata; runtime factory behavior is unchanged, with focused subclass/type and non-mutation coverage. Additional merged scope: #3999 annotates SeedIdentifier.from_seed with Self and adds base/subclass runtime and assert_type coverage. The final merged factory still delegates to cls.of(...); its executable body, behavioral parameter projection, hashes, promoted fields and serialization are unchanged. Additional merged scope: #4064 annotates GCGDataConfig.from_json / from_json_file and GCGConfig.from_json / from_json_file / _from_dict in pyrit/executor/promptgen/gcg/config.py with Self, with subclass runtime and assert_type coverage for JSON and file entry points. The existing cls construction, parsing, validation, defaults, nested configuration types and errors are unchanged. Slai.life (@huong8373tt-beep)'s reservation is released. No further focused case is identified here; propose a concrete subclass-preserving factory or fluent-API gap before claiming more work. The broad opportunity remains unchecked pending maintainer acceptance. Preserve fixed-base TagQuery.__and__/__or__ and ComponentIdentifier.with_eval_hash, independent generics and factories such as SeedPrompt.from_value_with_required_parameters that can return an existing base input. → Broken out to MAINT: remaining typing.Self adoption — inventory and split plan (P311-01, from #3166) #4504; claim and contribute there, not here.
  • P311-02: Improve dictionary contracts with TypedDict, Required, and NotRequired. Investigate internal metadata/provider payloads currently typed as dict[str, Any]. Distinguish absent keys from nullable values. RawAnalyticsProfile already provides prior art. Do not replace Pydantic runtime validation. Merged scope: #4106 types the Docker build-info payload in pyrit/backend/routes/version.py with BuildInfo: source, commit, modified and display are NotRequired, and commit also permits explicit None from PyPI/no-commit Docker builds. JSON loading, warning fallback and absent-display package-version fallback remain unchanged; tests pin optional-key annotations and nullable-commit route behavior. B Sainath Reddy (@Sainath-Reddy7)'s reservation is released. No further focused case is identified here; propose a concrete metadata/provider dictionary with stable keys and a meaningful absent-versus-nullable contract before claiming more work. The broad opportunity remains unchecked pending maintainer acceptance. → Broken out to MAINT: remaining TypedDict contracts for stable-key internal payloads (P311-02, from #3166) #4505; claim and contribute there, not here.
  • P311-03: Add exhaustive dispatch checks with assert_never / Never. Investigate closed enum/union dispatch for outcomes, states, modalities, or capabilities so added cases surface during type checking. Apply only where handling is genuinely exhaustive, not to intentionally open extension points. Merged scope: #3441 makes AttackStrategy._log_attack_outcome exhaustive across AttackOutcome, preserving existing log messages and rejecting unknown values. Additional merged scope: #3456 explicitly handles ScenarioResultView.CONVERSATIONS and guards both CLI dispatchers with assert_never, preserving HTML full-report override, default view, limits and lazy imports. Additional merged scope: #3472 makes AttackResultAnalytics._option exhaustive for all four AttackAnalyticsValueKind members, preserving display labels and stored keys, with an actual-source enum-extension type regression. Additional merged scope: #3504 explicitly handles all three PuzzleType members in PuzzledConverter.convert_async and adds an assert_never guard with a runtime regression. Constructor validation, crossword fallback, RNG behavior, Unicode handling, clues and output are preserved. Additional merged scope: #3601 covers all five CodeAttackConverter._encode encodings with a type-only assert_never guard, preserving the runtime invalid-state ValueError, constructor validation, template pairing and output. Per-encoding, invalid-state and actual-source type checks cover the change. Additional merged scope: #3654 adds an exhaustive assert_never guard for the validated RepeatTokenConverter mode dispatch, preserving its string-Literal API, None defaulting to split, validation errors/messages, punctuation, spacing, output and identifiers. The unreachable fallback uses the existing coverage exclusion pattern; changed-line coverage passed at 100%. Additional merged scope: #3797 makes PromptShieldTarget._input_parser exhaustive for its three declared Literal values with a TYPE_CHECKING-only assert_never. Shared parsing preserves forced-field early returns, None and unknown-runtime-field fallback, and trailing document text; a regression covers the fallback. Additional merged scope: #3830 makes HumanLabeledDataset.from_csv entry construction exhaustive for MetricsType.HARM and MetricsType.OBJECTIVE, with a type-only assert_never. CSV parsing, validation and the unknown-runtime-value objective fallback are preserved. Additional merged scope: #3924 makes ScorerEvaluator.from_scorer constructor selection exhaustive for both MetricsType members with a type-only guard. Omitted-type inference, explicit overrides and the historical unknown-runtime-value harm fallback are preserved. The final merged tests include the actual factory source checked against current and extended enums, addressing the coverage gap. Additional merged scope: #3998 makes TargetConfiguration.ensure_can_handle exhaustive for UnsupportedCapabilityBehavior RAISE/ADAPT with a type-only guard. Native-support and configured-normalizer early returns, missing-policy handling, error messages and the historical runtime fallback are preserved. The final tests check the actual method source against current and extended enums for Python 3.11/3.12, so removing the guard is detected. B Sainath Reddy (@Sainath-Reddy7)'s reservation is released. Additional merged scope: #4045 makes ScorerEvaluator.run_evaluation_async exhaustive for all three RegistryUpdateBehavior members with a type-only guard. Existing cache-reuse and registry-write policies, including the historical out-of-enum runtime fallback, are preserved. The final tests check the actual evaluator source against current and extended enums and require a failure at this dispatch's assert_never. Lanre Shittu (@Shizoqua)'s reservation is released. No further concrete case is identified here; propose a genuinely closed dispatch gap before claiming more work. The broad opportunity remains unchecked. Keep open string, custom-callable and provider-extension dispatch unchanged. → Broken out to MAINT: remaining assert_never exhaustive-dispatch guards — inventory and batches (P311-03, from #3166) #4506; claim and contribute there, not here.
  • P311-04: Add type-regression checks with assert_type. Investigate registry factories, generic results, decorators, and subclass-returning APIs. Ensure checks run through the type checker; assert_type is not a runtime assertion. Additional merged scope: #3625 adds assert_type(results, list[int]) for gather_with_cleanup_async and checks ordered values in tests/unit/test_async_utils.py. The canonical make ty checks tests/unit; the generic helper, public signature and cancellation/cleanup behavior are unchanged. Additional merged scope: #3686 adds concrete and protocol-consumer assert_type checks for DefaultInstanceRegistry[T].get, get_entry and get_all_instances, retaining T | None, RegistryEntry[T] | None and list[RegistryEntry[T]]. Present/missing retrieval, identity and sorted order are checked; the protocol consumer uses a helper parameter to avoid concrete assignment narrowing. Production signatures and runtime behavior are unchanged. Additional merged scope: #3770 adds four assert_type checks for the raw singleton-factory results of SlowConstructingRegistry and OtherSlowConstructingRegistry before runtime narrowing. Identity, subclass isolation, synchronization, timeouts and cleanup are preserved; production signatures and behavior are unchanged. Assessment: sufficiently addressed for this selective opportunity. Existing CI-checked coverage now protects generic gather results, concrete and protocol instance-registry retrieval, and subclass-returning factories including this singleton case. Controlled annotation regressions fail these checks. The bounded assessment found no additional worthwhile typing case to prescribe; this is not an exhaustive audit or a requirement to add assertions to every registry/generic API. The separate backend timing-test change in TEST: Assert Registry.get_registry_singleton return types (P311-04) #3770 is CI-reliability work, not P311-04 scope. Its traversal-oracle caveat does not reopen the completed typing case.
  • P311-05: Investigate LiteralString at static-template boundaries. Consider developer-authored SQL or command templates where the type checker can enforce the distinction. Confirm checker support. This is not runtime sanitization and never replaces parameterized SQL. Investigation report: Slai.life (@huong8373tt-beep) submitted a bounded no-change report on SQL/command static-template boundaries and checker enforcement. The contributor withdrew the reservation. ✅ Accepted as no-change by the maintainer on 2026-11-18 (acceptance with checker-claim correction): ty does flag str → LiteralString in production code, so the no-change stands on the structural findings alone.
  • P311-06: Investigate TypeVarTuple / Unpack for variadic types. Look for a concrete heterogeneous-tuple or numerical/multimodal API that benefits. Do not add variadic complexity without a real need or assume this automatically checks NumPy shapes. Features standardized after 3.11 still need compatible backports. Investigation report: Slai.life (@huong8373tt-beep) submitted a bounded no-change report on heterogeneous tuple/multimodal variadic contracts. The contributor withdrew the reservation. ✅ Accepted as no-change by the maintainer on 2026-11-18 (acceptance).
  • P311-07: Investigate generic TypedDict / NamedTuple containers. Identify payload containers whose content type should be parameterized. Generic TypedDict in analytics result analysis provides existing prior art. Merged focused scope: #4053 parameterizes TechniqueTokenResolution and resolve_technique_tokens in pyrit/scenario/core/technique_tokens.py by the concrete scenario technique enum, with assert_type and runtime coverage. Resolution behavior and dataclass fields are unchanged. This is generic dataclass typing, not a new generic TypedDict or NamedTuple; TechniqueToken contains only strings and needs no type parameter. Existing pyrit/analytics/result_analysis.py::_AnalysisResult remains generic TypedDict prior art. The contributor reservation is released. ✅ Closed as no-change on 2026-11-20 after a maintainer-side sweep (details): no remaining container has a justified payload-type relationship; remaining Any/object fields are mixed-type by design.

Async execution and diagnostics

  • P311-08: Enrich propagated exceptions with BaseException.add_note. Add useful execution, technique, dataset, or conversation context while preserving exception types and tracebacks. Notes appear in formatted tracebacks, not str(error). Exclude secrets and sensitive prompt content. Merged scope: #3175 adds dataset/provider notes to concurrent provider-fetch failures. Additional merged scope: #3277 adds scenario and atomic-attack names to caught worker-pool exceptions in Scenario._execute_atomic_attacks_parallel_async, preserving the original exceptions and existing single/grouped failure behavior. Regression coverage checks grouped notes and single-failure identity. Additional merged scope: #3281 labels cached-backend and analytics close failures in close_services_async, preserving the original exceptions, cancellation and single/grouped behavior. Additional merged scope: #3333 adds safe static phase notes for scenario-service shutdown and memory disposal in RuntimeLifecycle._shutdown_runtime_async. Existing notes, original exception identity/type, cleanup order, cancellation and single/grouped behavior remain intact. Additional merged scope: #3351 adds safe static session-release, active-client-stop and failed-startup-client-stop notes in GitHubCopilotTarget._cleanup_owned_resources_async, with regression coverage for phase labels and original errors. Complete: the identified dataset/provider, scenario-worker, backend service-close, runtime-shutdown and Copilot-cleanup context gaps are addressed. Current-code assessment found no further concrete, worthwhile propagation-context gap requiring another contribution for this item. Other examined groups already describe their operation or preserve ordered/chained causes; this is not a requirement to annotate every exception. Retain original exception identity/type/tracebacks, prior notes, cancellation, cleanup/retry ownership and single/grouped behavior; never add secrets or sensitive prompt content.
  • P311-09: Use scoped operation timeouts with asyncio.timeout. Investigate multi-await operations that should share one timeout scope instead of restarting a timeout for every step. Existing analytics, objective-generation, observation, and A2A usage provides prior art. Preserve cancellation and cleanup behavior. Merged scope: #3205 gives each Copilot receive loop one overall budget across streamed messages, with separate handshake/response budgets and cancellation/cleanup coverage. Completed: #3239 gives WebSocketTarget._initialize_connection_async one separate receive budget across all discarded initial messages, with aggregate-budget and cancellation/connection-cleanup coverage. Initialization sends, restoration, and normal responses retain their separate scopes. Current timeout-site assessment found no further worthwhile shared-budget migration: remaining wait_for calls bound individual operations, explicitly per-attempt probes, or already use a shared remaining deadline. Do not mechanically replace those calls.
  • P311-10: Propagate absolute deadlines with asyncio.timeout_at. Investigate nested operations/retries that should share one monotonic-clock deadline. Distinguish operation deadlines from per-step timeouts and keep cleanup semantics explicit. Merged scope: #3610 bounds _run_invocation_async in pyrit/_code_execution/docker_client.py with asyncio.timeout_at(deadline) during shielded Docker client startup and passes that same monotonic deadline into invocation handling. Capture and attached-client waiting already deducted elapsed time before this change; the new bound is startup. Startup-specific errors and cleanup ownership remain intact. Assessment: sufficiently addressed; no further worthwhile production migration was demonstrated in the inspected current timeout/retry surfaces. Existing A2A polling, WebSocket initialization, Copilot receive streaming and objective-generation execution already use shared scoped budgets, while QueryControl already computes one absolute deadline. Preserve independently bounded control commands and cancellation/container/workspace cleanup outside the expired invocation budget. The added test checks deadline wiring; behavioral expiry/cancellation regression coverage is an optional test follow-up, not an additional production migration or active reservation.
  • P311-11: Investigate structured concurrency with asyncio.TaskGroup. Identify parent-scoped child tasks with appropriate fail-fast semantics. The message-send service already uses it. It is not a blanket gather replacement or a concurrency limiter: sibling cancellation and exception shapes differ. Preserve ordered results and the deliberate cancellation/cleanup behavior in pyrit/common/task_utils.py. Merged scope: #3959 covers _AnthropicModelWrittenEvalsDataset._fetch_dataset_async: ordered file fetches now use an awaited owned task containing a TaskGroup. First-error identity and caller cancellation are preserved, including the Python 3.11/3.12 internal-cancellation-count regression; failure and outer cancellation drain async siblings. File/cache writes already running in threads cannot be interrupted. Further merged scope: #3980 covers Converter._convert_token_regions_async using the existing gather_with_cleanup_async helper, not a new TaskGroup migration. Failed or externally cancelled selected-region conversions drain async siblings while preserving result order, original errors and caller cancellation counts. File writes already running in threads remain non-interruptible. Víctor Fernández Ayllón (@vayllon301)'s reservation is released. No further focused case is identified here; propose a concrete remaining gap before claiming more work. The broad structured-concurrency opportunity remains unchecked pending maintainer acceptance. → Broken out to MAINT: fail-fast gather fan-outs should drain siblings via gather_with_cleanup_async (P311-11, from #3166) #4507; claim and contribute there, not here.
  • P311-12: Investigate ExceptionGroup / except* handling. Preserve multiple failures and, where useful, handle matching subsets without losing other errors. Groups already exist in scenario execution and service shutdown. Carefully assess public exception contracts and cancellation (BaseExceptionGroup). Focused contribution merged: #3983 preserves shutdown errors and disposal for mixed groups, propagates live-apply cancellation groups, retains secondary Anthropic fetch failures as notes, and includes nested child failures and explicit causes in scenario diagnostics. Ordinary-error output and the original Anthropic exception contract remain unchanged, with focused regression coverage. Muhammad Waqar Anwar (@WaqarAnwar)'s reservation is released. ✅ Closed as no-change on 2026-11-20 after a maintainer-side sweep (details): all group-producing paths preserve failures; no reachable gap beyond the merged FIX: Preserve failures in exception group handling (P311-12) #3983 scope.
  • P311-13: Investigate explicit task context with asyncio.create_task(..., context=...). Identify background operations that need selected tracing/execution ContextVars or a clean context. Default task creation already copies the current context; do not change it gratuitously. Investigation reported: @WaqarAnwar's findings report no current production bug and an execution-context carryover risk when a scheduled run fails in its own task rather than an attack worker. The report used a mock scenario and did not inspect every task creation call; this is not an independently verified production reproducer. A clean context for each scheduled run remains a proposed option, not a requirement. ✅ Accepted as a point-in-time no-change investigation by the maintainer on 2026-11-18 (acceptance; ContextVar census and preserve-on-exception behavior independently verified).
  • P311-14: Investigate asyncio.Runner for synchronous entry points. Consider multiple top-level calls sharing one managed loop/context in a shell or lifecycle harness. This does not permit nested loops inside an already-running notebook event loop. Preserve resource and loop ownership. Investigation reported by Slai.life (@huong8373tt-beep) (reservation released): Report finds no justified Runner change in the one-shot scan/migration CLIs, persistent shell loop, synchronous embedding facade or platform-specific browser-authentication loop. ✅ Accepted as no-change by the maintainer on 2026-11-18 (acceptance; all four surfaces independently verified). No mechanical substitution is requested.

Standard-library simplifications

  • P311-15: Parse project TOML with tomllib. Investigate replacing the version-extraction regex in build_scripts/stamp_compatibility.py with structured access to project.version. Preserve validation/provenance behavior. tomllib reads TOML; it does not write it. Completed: #3208 replaces the version regex with structured project.version parsing and covers table ordering, quoting, invalid metadata, and provenance errors.
  • P311-16: Simplify ISO timestamp parsing. Investigate removing trailing-Z compatibility rewrites, such as _RemoteDatasetLoader._parse_datetime, because 3.11 parses valid Z timestamps directly. Preserve timezone and accepted-input contracts. Do not edit immutable historical Alembic revisions merely for cleanup. Completed: #3176 removes the active loader shim and preserves invalid/non-string fallback behavior. Post-merge search found no other actionable ISO-parsing compatibility shims in pyrit or build_scripts; the remaining rewrite in historical migration d7e9f1a3b5c6 is intentionally immutable.
  • P311-17: Assess enum.StrEnum for appropriate enums. It is already used for harm categories and message-send models. Existing str, Enum migrations can change str(member) and formatting, and Ruff's automatic replacement is deliberately disabled. Focus on cases where string behavior is intended and compatibility is understood. Merged scope: #3850 migrates ConversationRetryReason to StrEnum. str() and formatting intentionally now return json_parsing instead of the class-qualified name; members, equality/hash/repr, JSON, value lookup and the ConversationRetry model remain compatible. Additional merged scope: #4126 migrates SeedOrigin in pyrit/models/seeds/seed_origin.py to StrEnum. String conversion/formatting intentionally return its existing values; all five values, repr, equality/hash, JSON/schema and persisted-seed reconstruction are preserved, with focused enum and raw-storage round-trip coverage. Goutham Mahesh (@GouthamMahesh)'s reservation is released. Remaining investigation candidate: ScenarioResultView in pyrit/cli/_cli_args.py still uses str, Enum specifically for argparse round trips. Check CLI help/choices, formatting and saved argument compatibility before proposing a migration; this is not a finding that conversion is safe or necessary. The broad item remains unchecked and available for a bounded investigation. Do not blanket-convert existing string enums. → Broken out to MAINT: StrEnum — fix the four observable cases; optional batch for the rest (P311-17, from #3166) #4508; claim and contribute there, not here.
  • P311-18: Investigate atomic regex groups and possessive quantifiers. Consider (?>...), *+, or ++ in a concrete scorer/parser pattern with unnecessary backtracking on large model outputs. Measure behavior and performance; these constructs change matching semantics and are not a universal regex-safety fix. Merged scope: #3702 uses atomic groups and whole-flag-token guards in ShellCommandOutputScorer's destructive rm branch. Historical detection cases and malformed/repeated-input regressions preserve the tested heuristic behavior; measured long-input families scale approximately linearly. Assessment: sufficiently addressed for this concrete opportunity. The actual squash and assessed current code have identical scorer/test files. This is not a proof for every regex/input or a requirement to migrate every pattern; retain command-separator behavior, /tmp exclusion and whole flag tokens. The scorer evaluates text, not shell execution. Additional merged scope: #3764 adds multiline Markdown-image detection with possessive scanner patterns and a CommonMark block parser. Reference normalization, code/HTML context, custom-pattern opt-out and bounded malformed-input regressions are covered. The actual merged scorer/tests and dependency files are unchanged in assessed current main. Existing regex matching is retained, so this is not complete CommonMark equivalence or a globally linear scorer claim. It does not change the completed shell assessment or require a blanket migration. The earlier unclaimed item overlap remains in the historical row; no reservation was retroactively granted. Additional merged scope: #3687 deliberately uses possessive shell-word/option scans and atomic operand alternatives while changing command-substitution detection semantics. Twelve checked-in malformed-input shapes time regex search below 0.5 seconds and separately check the public false verdict. This is supplemental performance-bounded use, not a semantics-preserving migration or a second completion. The inherited destructive-shell atomic pattern is unchanged and remains counted under FIX: Make ShellCommandOutputScorer destructive-shell regex linear time #3702. The merged shell scorer and dedicated tests match assessed current main; the general regex tests later changed default-pattern identity assertions separately. Shell-oracle and growth results in the PR are author-reported, not independently rerun here, and do not establish global linearity or atomic-versus-nonatomic equivalence. No blanket migration or new reservation is needed.
  • P311-19: Investigate hashlib.file_digest for whole-file hashes. Consider classifier artifact verification or other complete-file checks. Keep blocking I/O off async paths. Do not replace bounded evidence-reading loops that enforce budgets/cancellation and retain content. Merged scope: #3392 streams the two classifier compute_dataset_hashes() helpers through binary hashlib.file_digest handles, preserving SHA-256 values and dictionary order; multi-buffer regression tests cover current file contents. Assessment: sufficiently addressed. Keep _load_training_rows() hashing the same bytes it subsequently parses; keep LocalFileSurfaceSource._read_entry bounded/cancellable with retained evidence. Async serializer hashing supports storage backends that may be remote, memory media hashing reuses copied content, and FileDocumentStorage._compute_version receives bytes already in memory. No further worthwhile direct whole-file replacement identified; do not add synchronous local-file reads to async storage paths.
  • P311-20: Investigate inspect.getmembers_static for safe introspection. Identify registry inspection that should avoid invoking descriptors/properties. It intentionally bypasses dynamic lookup and lazy exports, so verify the discovery contract before adoption. Merged scope: #3531 statically inspects discover_in_directory modules, resolves only explicitly declared missing __all__ exports dynamically, and logs failed declared exports without losing other classes. Registration-outcome tests cover declared lazy exports with/without __dir__, unrelated dynamic names and failed exports; the earlier lazy-export regression is addressed. Additional merged scope: #3580 statically inspects InitializerRegistry._module_defined_initializers for single-file discovery and custom scripts, with targeted resolution of declared lazy exports. Own-module, base-class and abstract filters remain intact. Best-effort discovery logs failed declared exports; strict script loading and custom-script validation still reject them. Registration and strict/best-effort entry-point regressions cover these contracts. Assessment: the registry inspection opportunity is sufficiently addressed by fix: use static member discovery in registry inspection #3531 and FIX avoid dynamic attribute evaluation in single-file initializer discovery #3580; no further worthwhile blanket migration was found. Keep Registry._discover's intentional lazy-export materialization dynamic.

SQLite-specific memory opportunities

These must stay in the SQLite-specific memory/driver layer and preserve portable SQL Server behavior. Check what SQLAlchemy/aiosqlite exposes before choosing an implementation.

  • P311-21: Improve SQLite error handling using extended error codes/names. Analytics already checks sqlite_errorcode for plain SQLITE_BUSY. Investigate other real cases where structured codes are preferable to error-message matching, including distinctions such as stale snapshots. Completed scope: #3893 adds the driver's sqlite_errorcode/sqlite_errorname as deduplicated exception notes on propagated SQLite analytics failures, making distinctions such as SQLITE_BUSY_SNAPSHOT visible. Plain-BUSY retry policy, exception identity/messages and non-SQLite behavior are unchanged. The current bounded memory-handler survey found no worthwhile remaining message-based SQLite classification to replace; existing structured-code and domain-state handling stays intact. This completes the implemented diagnostics case, not a new retry policy or blanket database migration, and does not retroactively accept the earlier no-change proposal.
  • P311-22: Investigate SQLite connection getlimit / setlimit. Identify a real need for connection-level runtime limits and how limits interact with pooling and workloads. Avoid arbitrary limits that break existing behavior. Current focused case (claimed by Pedro Holanda (@AoiUltramar)): investigate SQLite runtime bind-variable limits and the conservative batching constants in MemoryInterface and MemorySession. The proposal and preliminary benchmark are not accepted implementation evidence. Verify limits on the actual pooled connection rather than assuming a separate probe connection represents it, preserve Azure SQL behavior, and report reproducible pinned-environment measurements before proposing a capped SQLite-only change or no-change conclusion. Investigation update: Earlier report; follow-up no-change conclusion. The contributor withdraws the proposed 2000-bind SQLite batch after a second pinned-environment run did not reproduce the earlier API-level improvement. They report pooled connection limits of 32766 variables and 1000 expression depth, and an end-to-end expression-depth failure when increasing the shared cap. Maintainer review 2026-11-18 (push-back): the withdrawal of the 500→2000 bump is accepted (independently re-checked), but a plain no-change is not — a small capped PR is requested: bound json_batch_size in _execute_get_prompt_scores to min(_MAX_BIND_VARS, 500) - 1 and add a >1000-ID get_prompt_scores regression test, fixing a likely live Azure SQL parameter-cap failure (~3998 parameters vs the 2100 cap). The item stays open for that PR. → Broken out to FIX: bound get_prompt_scores JSON batching to the parameter cap (P311-22, from #3166) #4509; claim and contribute there, not here.
  • P311-23: Investigate SQLite custom window functions. Assess whether an actual analytics use case benefits from create_window_function, with SQLite runtime support, driver integration, and portability considered. Prefer existing SQL when sufficient. ✅ Closed as no-change on 2026-11-20 after a maintainer-side sweep (details): existing windowed SQL uses portable SQLAlchemy .over(...); no analytics path benefits from a SQLite-only registered window function.
  • P311-24: Investigate incremental SQLite BLOB I/O. Assess whether any actual large-BLOB storage path benefits from blobopen. Do not redesign media storage just to use this API; a no-change conclusion may be appropriate. ✅ Closed as no-change on 2026-11-20 after a maintainer-side sweep (details): no binary columns exist; media bytes are streamed to disk/Azure Blob Storage and the DB stores paths, so blobopen has no target.
  • P311-25: Investigate SQLite database serialization/deserialization. Assess a concrete snapshot/test/export use case for serialize / deserialize, including runtime availability, memory cost, concurrency, and driver boundaries. Investigation report: Shawn Russ (@shawnrruss) submitted a no-change report comparing serialize / deserialize snapshot restore with the existing migrated-template backup() reset in tests/unit/conftest.py. ✅ Accepted as no-change by the maintainer on 2026-11-18 (acceptance; the visibility matrix was independently reproduced).

Claim and PR tracking

The tracker is authoritative for per-item ownership; GitHub issue assignees are the aggregate set of active contributors. Available items have no active tracker row. Preserve released/expired rows as history when updating the tracker. Table frozen 2026-11-20: per-item claims now live on the dedicated issues linked above.

Item Contributor Claim comment / source Claimed on PR due PR Status
P311-25 Shawn Russ (@shawnrruss) Claim comment 2026-11-18 2026-11-23 None ✅ No-change report accepted by maintainer 2026-11-18; item complete; reservation released
P311-17 Goutham Mahesh (@GouthamMahesh) Claim comment 2026-11-10 2026-11-15 #4126 ✅ PR merged 2026-11-10; SeedOrigin case complete; reservation released
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-11-08 2026-11-13 #4064 ✅ PR merged 2026-11-09; focused GCG JSON factory typing complete; reservation released
P311-05 Slai.life (@huong8373tt-beep) Claim comment 2026-11-08 2026-11-13 None Released by contributor on 2026-11-08; ✅ no-change report accepted by maintainer 2026-11-18 (with checker-claim correction); item complete
P311-06 Slai.life (@huong8373tt-beep) Claim comment 2026-11-08 2026-11-13 None Released by contributor on 2026-11-08; ✅ no-change report accepted by maintainer 2026-11-18; item complete
P311-07 Slai.life (@huong8373tt-beep) Claim comment 2026-11-08 2026-11-13 #4053 ✅ PR merged 2026-11-08; focused generic resolution typing complete; reservation released
P311-03 Lanre Shittu (@Shizoqua) Claim comment 2026-11-07 2026-11-12 #4045 ✅ PR merged 2026-11-08; registry-update dispatch and typing regression complete; reservation released
P311-02 B Sainath Reddy (@Sainath-Reddy7) Claim comment 2026-11-07 2026-11-12 #4106 ✅ PR merged 2026-11-09; Docker build-info optional/nullable contract complete; reservation released
P311-14 Slai.life (@huong8373tt-beep) Claim comment 2026-11-06 2026-11-11 None yet Released by contributor on 2026-11-08; ✅ no-change report accepted by maintainer 2026-11-18; item complete
P311-22 Pedro Holanda (@AoiUltramar) Claim comment 2026-11-06 2026-11-11 None Expired 2026-11-11; reservation released 2026-11-15; 2000-bind withdrawal accepted by maintainer 2026-11-18; plain no-change not accepted — capped json_batch_size PR with >1000-ID regression test requested; item open
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-11-06 2026-11-11 #3999 ✅ PR merged 2026-11-06; focused SeedIdentifier factory typing complete; reservation released
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-11-05 2026-11-10 #3992 ✅ PR merged 2026-11-06; ToolExecutionMetadata factory typing complete; reservation released; SeedIdentifier factory case available
P311-03 B Sainath Reddy (@Sainath-Reddy7) Claim comment 2026-11-05 2026-11-10 #3998 ✅ PR merged 2026-11-06; capability-behavior dispatch and typing regression complete; reservation released
P311-12 Muhammad Waqar Anwar (@WaqarAnwar) Claim comment 2026-11-05 2026-11-10 #3983 ✅ PR merged 2026-11-06; focused exception-group investigation complete; reservation released
P311-11 Víctor Fernández Ayllón (@vayllon301) Claim comment 2026-11-05 2026-11-10 #3980 ✅ PR merged 2026-11-06; selected-region sibling cleanup complete; reservation released
P311-11 Muhammad Waqar Anwar (@WaqarAnwar) Claim comment 2026-11-04 2026-11-09 #3959 ✅ PR merged 2026-11-05; focused Anthropic file-fetch case complete; reservation released; selected-region converter case available
P311-03 B Sainath Reddy (@Sainath-Reddy7) Claim comment 2026-11-04 2026-11-09 #3924 ✅ PR merged 2026-11-05; focused ScorerEvaluator dispatch and typing regression complete; reservation released; capability-behavior case available
P311-17 Julio César Suástegui (@juliosuas) Claim comment 2026-11-04 2026-11-09 None Expired 2026-11-09; no matching PR opened within five days; SeedOrigin investigation available
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-11-03 2026-11-08 #3897 ✅ PR merged 2026-11-04; focused RequestTraceContext factory complete; reservation released; ToolExecutionMetadata case available
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-11-03 2026-11-08 #3884 ✅ PR merged 2026-11-03; focused TokenUsage factory complete; reservation released; RequestTraceContext case available
P311-17 Julio César Suástegui (@juliosuas) Claim comment 2026-11-02 2026-11-07 #3850 ✅ PR merged 2026-11-03; focused ConversationRetryReason case complete; reservation released; SeedOrigin investigation available
P311-03 Muhammad Waqar Anwar (@WaqarAnwar) Claim comment 2026-11-02 2026-11-07 #3830 ✅ PR merged 2026-11-03; dataset-entry dispatch complete; reservation released; evaluator dispatch available
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-11-02 2026-11-07 #3823 ✅ PR merged 2026-11-03; metadata factory typing complete; reservation released; TokenUsage case available
P311-02 XY (@XY-code1) Claim comment 2026-11-02 2026-11-07 None yet Expired 2026-11-07; no PR within five days; reservation released; prior GitHub assignment unavailable
P311-21 B Sainath Reddy (@Sainath-Reddy7) Claim comment 2026-11-01 2026-11-06 #3893 ✅ PR merged 2026-11-04; SQLite codes/names diagnostics assessed complete; reservation released; earlier survey retained as background
P311-18 Jaafer Rahmani (@bIackr0se) PR opened without prior claim 2026-10-31 N/A; not assigned #3764 ✅ PR merged 2026-11-02; Markdown-image scope complete; historical unclaimed overlap with #3702 retained; no reservation granted
P311-18 Muhammad Waqar Anwar (@WaqarAnwar) PR opened without prior claim 2026-10-31 N/A; PR already open #3702 ✅ PR merged 2026-11-01; destructive-shell scope complete; reservation released; prior GitHub assignment unavailable
P311-03 Slai.life (@huong8373tt-beep) Claim comment 2026-10-31 2026-11-05 #3797 ✅ PR merged 2026-11-02; PromptShield dispatch complete; reservation released; dataset-entry dispatch available
P311-03 Slai.life (@huong8373tt-beep) Claim comment 2026-10-29 2026-11-03 #3654 ✅ PR merged 2026-10-31; RepeatToken dispatch complete; reservation released; PromptShield parser available
P311-04 Muhammad Waqar Anwar (@WaqarAnwar) Request comment 2026-11-01 N/A; not assigned #3770 ✅ PR merged 2026-11-01; singleton checks complete; no active reservation; opened while #3702 active (historical one-item conflict)
P311-04 mehmetl33t Claim comment 2026-10-30 2026-11-04 #3686 ✅ PR merged 2026-10-31; instance-registry checks complete; reservation released; singleton-factory checks available
P311-04 Slai.life (@huong8373tt-beep) Claim comment 2026-10-29 2026-11-03 #3625 ✅ PR merged 2026-10-29; gather result-type check complete; reservation released; instance-registry type checks available
P311-01 Julio César Suástegui (@juliosuas) Claim comment 2026-11-01 2026-11-06 #3779 ✅ PR merged 2026-11-02; adversarial-prompts factory complete; reservation released; attack-result metadata factory available
P311-01 Julio César Suástegui (@juliosuas) Request comment 2026-10-28 2026-11-02 #3626 ✅ PR merged 2026-10-31; WebSearchConfig factory complete; reservation released; adversarial-prompts factory available
P311-01 Slai.life (@huong8373tt-beep) Claim, withdrawal 2026-10-29 N/A None Withdrawn 2026-10-29 before assignment; no reservation
P311-10 Slai.life (@huong8373tt-beep) Claim comment 2026-10-28 2026-11-02 #3610 ✅ PR merged 2026-10-29; Docker sandbox invocation deadline complete; opportunity complete; reservation released
P311-20 Slai.life (@huong8373tt-beep) Claim comment 2026-10-27 2026-11-01 #3580 ✅ PR merged 2026-10-28; single-file inspection complete; opportunity complete; reservation released
P311-03 Julio César Suástegui (@juliosuas) Claim comment 2026-10-27 2026-11-01 #3601 ✅ PR merged 2026-10-28; CodeAttack encoding dispatch complete; reservation released; RepeatToken mode dispatch available
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-10-26 2026-10-31 #3577 ✅ PR merged 2026-10-27; JSON response factory complete; reservation released; web-search policy factory available
P311-20 Slai.life (@huong8373tt-beep) Claim comment 2026-10-25 2026-10-30 #3531 ✅ PR merged 2026-10-26; directory discovery complete; reservation released; single-file initializer inspection available
P311-01 Julio César Suástegui (@juliosuas) Claim comment 2026-10-25 2026-10-30 #3529 ✅ PR merged 2026-10-26; HarmDefinition factory complete; reservation released; JSON response factory available
P311-01 Niladri Das (@bniladridas) Claim comment 2026-10-24 2026-10-29 #3520 ✅ PR merged 2026-10-25; run-size estimate factory complete; HarmDefinition factory available, reservation released
P311-03 Slai.life (@huong8373tt-beep) Claim comment 2026-10-24 2026-10-29 #3504 Closed without merging 2026-10-25; reopened 2026-10-26; ✅ PR merged 2026-10-26; puzzle dispatch complete; reservation released; CodeAttack encoding dispatch available
P311-03 Slai.life (@huong8373tt-beep) Claim comment 2026-10-23 2026-10-28 #3472 ✅ PR merged 2026-10-23; analytics option-kind dispatch complete; puzzle dispatch available, reservation released
P311-01 Julio César Suástegui (@juliosuas) Claim comment 2026-10-22 2026-10-27 #3470 ✅ PR merged 2026-10-23; TagQuery factory family complete; run-size estimate factory available, reservation released
P311-03 Slai.life (@huong8373tt-beep) Claim comment 2026-10-22 2026-10-27 #3456 ✅ PR merged 2026-10-23; CLI result-view dispatch complete; analytics option dispatch available, reservation released
P311-03 Slai.life (@huong8373tt-beep) Claim comment 2026-10-21 2026-10-26 #3441 ✅ PR merged 2026-10-22; AttackOutcome logging complete; CLI view dispatch available, reservation released
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-10-21 2026-10-26 #3411 ✅ PR merged 2026-10-21; placeholder factory complete; further TagQuery family available, reservation released
P311-01 Slai.life (@huong8373tt-beep) Claim comment 2026-10-20 2026-10-25 #3383 ✅ PR merged 2026-10-21; factory family complete; remaining MessagePiece case available, reservation released
P311-19 ARJUN K (@arjun-k047) Claim comment 2026-10-20 2026-10-25 #3392 ✅ PR merged 2026-10-20; P311-19 complete; reservation released
P311-08 Slai.life (@huong8373tt-beep) Claim comment 2026-10-19 2026-10-24 #3351 ✅ PR merged 2026-10-20; opportunity complete; reservation ended
P311-08 Slai.life (@huong8373tt-beep) Claim comment 2026-10-19 2026-10-24 #3333 ✅ PR merged 2026-10-19; contribution complete; Copilot cleanup-phase investigation available, reservation released
P311-08 Slai.life (@huong8373tt-beep) Claim comment 2026-10-17 2026-10-22 #3281 ✅ PR merged 2026-10-19; contribution complete; runtime-shutdown phase context remains available, reservation released
P311-08 Slai.life (@huong8373tt-beep) Claim comment 2026-10-16 2026-10-21 #3277 ✅ PR merged 2026-10-17; contribution complete; service-shutdown context remains available, reservation released
P311-01 成功したナイロンカエル (@vito233) Claim comment 2026-10-16 2026-10-21 #3266 ✅ PR merged 2026-10-17; contribution complete; further model factory cases available, reservation released
P311-09 Aizen__28 (@Yudeeswaran) Claim comment 2026-10-15 2026-10-20 #3239 ✅ PR merged 2026-10-16; opportunity complete; reservation ended
P311-15 Shivam Maurya (@shivampwm2020) Claim comment 2026-10-14 2026-10-19 #3208 ✅ PR merged 2026-10-14; opportunity complete; reservation ended
P311-01 Kushal Talati (@kushaltalati) Claim comment 2026-10-14 2026-10-19 #3201 ✅ PR merged 2026-10-14; contribution complete; further model factory cases available, reservation released
P311-09 Aizen__28 (@Yudeeswaran) Claim comment 2026-10-14 2026-10-19 #3205 ✅ PR merged 2026-10-14; contribution complete; initialization timeout investigation available, reservation released
P311-01 Kushal Talati (@kushaltalati) Claim comment 2026-10-13 2026-10-18 #3194 ✅ PR merged 2026-10-14; contribution complete; remaining cases available, reservation released
P311-08 Aizen__28 (@Yudeeswaran) Claim comment 2026-10-13 2026-10-18 #3175 ✅ PR merged 2026-10-13; contribution complete; remaining cases available, reservation released
P311-16 Kushal Talati (@kushaltalati) Claim comment 2026-10-13 2026-10-18 #3176 ✅ PR merged 2026-10-13; opportunity complete; reservation ended
P311-04 Roman Lutz (@romanlutz) Historical PR, opened before this issue; no claim N/A N/A #3064 ✅ PR merged; prior art covers part of the opportunity; remaining cases available

Describe alternatives you've considered, if relevant

Keep existing implementations when they already express the required behavior clearly. Avoid a repo-wide modernization sweep: each contributor investigates and opens a focused PR for ONE opportunity at a time. Separate changes within an item should remain cohesive; coordinate here before splitting or expanding scope.

Additional context

  • Python 3.11 release notes
  • Article motivating this inventory
  • Existing adoption includes datetime.UTC, Self, NotRequired, generic TypedDict, StrEnum, TaskGroup, timeouts, exception groups, and SQLite extended error codes.
  • Better traceback locations and interpreter improvements arrive automatically on 3.11+; they do not need modernization PRs, and model-call performance is often network-bound.
  • typing.override, typing.TypeAliasType, the type Alias = ... statement, and class Foo[T] syntax are 3.12+, not 3.11. Keep needed typing_extensions imports while supporting 3.11.
  • Other 3.11 APIs such as dataclass_transform can be considered when there is a concrete fitting abstraction, but should not motivate new abstractions on their own.

Activity

  1. romanlutz commented on Oct 13, 2026

    @romanlutz
    ContributorAuthor

    Roman Lutz (@romanlutz): P311-04 has related work in #3064, which opened on 2026-10-09 at 22:00:12 UTC, before this tracking issue existed, and merged on 2026-10-13 at 07:06:53 UTC. There was no prior claim here, so this is historical overlap, not a contributor bypassing the new claim rule.

    That PR adds assert_type checks for retry helpers and async task return types, and brings the unit tests into the make ty check. It partially addresses the type-regression opportunity. I am linking it as prior art but leaving P311-04 unchecked and available pending your assessment of the remaining scope. No duplicate claim exists and no new assignment is needed for the already-merged PR.

  2. Yudeeswaran commented on Oct 13, 2026

    @Yudeeswaran
    Contributor

    Claiming P311-08 (BaseException.add_note).

    I’ll investigate dataset-fetch failure propagation in SeedDatasetProvider.fetch_datasets_async (pyrit/datasets/seed_datasets/seed_dataset_provider.py). Providers are fetched concurrently, and a failing provider’s exception may propagate without identifying the dataset (e.g., “SeedDataset cannot be empty”).

    I plan to add diagnostic context using add_note(), including the dataset name and provider class, while preserving the original exception type and traceback.

    I’ll add a regression test to verify that the original exception is preserved and that the diagnostic note contains the expected dataset and provider information, without exposing prompt content or other sensitive data.

  3. romanlutz commented on Oct 13, 2026

    @romanlutz
    ContributorAuthor

    Assigning P311-08 to you Aizen__28 (@Yudeeswaran).

  4. kushaltalati commented on Oct 13, 2026

    @kushaltalati
    Contributor

    Claiming P311-16 (Simplify ISO timestamp parsing).
    I'll remove the .replace("Z", "+00:00") workaround in _parse_datetime since Python 3.11 handles it natively. Historical Alembic revisions will remain untouched. I'll preserve timezone and accepted-input contracts and update test coverage.

  5. romanlutz commented on Oct 13, 2026

    @romanlutz
    ContributorAuthor

    Assigning P311-16 to you Kushal Talati (@kushaltalati). Linked #3176 and Aizen__28 (@Yudeeswaran)'s #3175 in the table.

  6. romanlutz commented on Oct 13, 2026

    @romanlutz
    ContributorAuthor

    Post-merge assessment for P311-08: #3175 is merged and successfully covers dataset/provider context on concurrent dataset-fetch failures. Thank you Aizen__28 (@Yudeeswaran); your contribution is complete and your reservation is released, so you may claim another opportunity.

    The broader exception-note opportunity remains unchecked and available. I assessed the merged diff and current main at 20b35221c514b7f0898caac12f14b71631889027 and added two concrete follow-up cases to the checklist:

    • Scenario._run_atomic_attacks_parallel_async: caught errors are stored without their atomic-attack association before aggregation. Safe scenario/atomic-group notes could identify which concurrent operation failed without logging seed text.
    • close_services_async: exception notes could identify which close operation produced each grouped shutdown error.

    These are focused investigations, not instructions to annotate every exception. Preserve cancellation, exception identities/types, group contracts, and sensitive-data boundaries. Claim exactly one opportunity on this thread before starting.

  7. kushaltalati commented on Oct 13, 2026

    @kushaltalati
    Contributor

    PR #3176 is approved with all CI checks passing. Once merged, I would like to claim P311-01 (Extend typing.Self adoption).

    I plan to investigate adopting typing.Self across classmethod factories and fluent methods (such as YamlLoadable.from_yaml_file and Seed.from_yaml_file) while preserving independent generic parameters.

  8. romanlutz commented on Oct 13, 2026

    @romanlutz
    ContributorAuthor

    P311-16 is complete with #3176. No other active ISO-parsing workarounds remain; the historical migration stays unchanged. Assigning P311-01 to you Kushal Talati (@kushaltalati) now that #3176 is merged.

  9. 248 remaining items

  10. shawnrruss commented on Nov 19, 2026

    @shawnrruss
    Contributor

    P311-25 result: keep the current SQLite test-fixture reset (no PR).

    I compared snapshot restore with the existing migrated-template sqlite3.Connection.backup() in tests/unit/conftest.py at b6969d6.

    • Direct restore breaks the fixture contract. The sync connection could read the restored schema, but a fresh aiosqlite connection to the same named in-memory database could not. A separate native SQLite check reproduced that visibility failure.
    • Staged restore preserves isolation but was slower. Deserializing into a private connection and backing up into the shared destination passed the fixture isolation checks. On the unaugmented fixture, median lifetime was 847 → 951 µs and 779 → 877 µs (existing → staged). Staging lost all 42 paired batches, kept a 446,464-byte snapshot, and added one-time serialization. Linux x86-64, Python 3.12.14, SQLite 3.53.1; this measures the fixture lifecycle with an empty test body, not suite-wide speed.
    • Verification: The unchanged fixture passed 264 scoped SQLite tests (seven SQL Server cases deselected). Follow-up passed one migration/template/reset probe on each of two pytest workers and four real downstream tests for batched reads and observation storage. The run used hash-verified source files from that revision and compatible installed test-runner versions, not a complete locked checkout or platform matrix.

    Reproduce the visibility difference with Python and SQLite builds that expose serialize and deserialize:

    import sqlite3
    
    src = sqlite3.connect(':memory:')
    src.execute('create table marker (value integer)')
    src.execute('insert into marker values (1)')
    src.commit()
    image = src.serialize()
    
    for mode in ('backup', 'direct', 'staged'):
        uri = f'file:p311_25_{mode}?mode=memory&cache=shared'
        dst = sqlite3.connect(uri, uri=True)
        if mode == 'backup':
            src.backup(dst)
        elif mode == 'direct':
            dst.deserialize(image)
        else:
            staging = sqlite3.connect(':memory:')
            staging.deserialize(image)
            staging.backup(dst)
            staging.close()
        reader = sqlite3.connect(uri, uri=True)
        query = "select count(*) from sqlite_master where name = 'marker'"
        print(mode, dst.execute(query).fetchone()[0],
              reader.execute(query).fetchone()[0])
        reader.close()
        dst.close()
    src.close()

    Observed keeper/fresh-reader counts: backup 1/1, direct 1/0, staged 1/1. To repeat the timing on the real fixture, use the migrated sqlite_template for both paths and pass an adapter exposing backup(destination) to sqlite_instance. Serialize once per worker for the staged path and time fixture entry through teardown; the run warmed up 30 fixtures per path and alternated order across 21 paired batches of 32 fixtures per path in each process.

    I recommend closing this item as no change if the evidence meets the acceptance bar. No fixture or production code was changed. The investigation used AI assistance.

  11. romanlutz commented on Nov 19, 2026

    @romanlutz
    ContributorAuthor

    Thanks Shawn Russ (@shawnrruss). I've linked your report under P311-25. Its no-change conclusion remains pending maintainer acceptance, so the item stays unchecked. Your reservation stays recorded until 2026-11-23 unless you release it sooner.

  12. romanlutz commented on Nov 19, 2026

    @romanlutz
    ContributorAuthor

    P311-05 accepted — the item stays no-change and comes off the open list. One correction for the record: the checker probe doesn't hold up. ty flags passing a plain str to a LiteralString parameter in 0.0.96, 0.0.97 (what was locked at the time), and the current 0.0.99, and invalid-argument-type is enabled for production code in our ty config — it's only ignored under tests/unit/** and the HuggingFace target, so the probe likely ran under one of those ignore paths. The no-change conclusion stands on the structural findings, which I verified: the memory backends' text() fragments interpolate only internal structure with data values bound, Docker execution is exec-style over an allowlisted tuple, and there is no developer-authored SQL/command template boundary where LiteralString models a real contract without redesigning the builders. Checking it off.

  13. romanlutz commented on Nov 19, 2026

    @romanlutz
    ContributorAuthor

    P311-06 accepted. I spot-checked the candidate classes against main: the fixed heterogeneous tuples are stable fixed-arity returns where variadics add nothing, and multimodal content is an open MessagePiece sequence with no static positional shape to preserve. No variadic contract worth introducing today. Checking the item off.

  14. romanlutz commented on Nov 19, 2026

    @romanlutz
    ContributorAuthor

    P311-13 accepted — thanks for the careful trace. I verified the census (exactly 18 ContextVars in pyrit/ at your report date) and the deliberate preserve-on-exception behavior of the execution context. Two notes for the record: #4024 has since switched queued-run launches to create_task(..., context=caller_principal_context(...)) — a context copy with the caller principal replaced, not a clean Context(), so the carryover you describe is still theoretically possible in the fail-in-own-task case and your proposed fix remains the right shape if we ever need it; and the repo is at 26 ContextVars now, so newer vars are outside this sweep. Neither changes the no-change conclusion for current behavior. Checking it off.

  15. romanlutz commented on Nov 19, 2026

    @romanlutz
    ContributorAuthor

    P311-14 accepted. I verified all four surfaces on main: one-shot asyncio.run in the scan/migrate CLIs, the shell's persistent background-thread loop with run_coroutine_threadsafe, the per-call sync embedding facade, and the deliberate Proactor loop for Playwright on Windows. None of them has a multi-call lifecycle that Runner improves without inventing a new ownership contract. Checking the item off.

  16. romanlutz commented on Nov 19, 2026

    @romanlutz
    ContributorAuthor

    P311-22: I'm accepting the withdrawal of the 500→2000 bump — your second run matches my own re-check (raw execute+fetch for 10k IDs is ~8-9 ms at either batch size on my machine; the cost is sorting and ORM loading, not binding), and I reproduced the expression-depth failure near 1000 OR terms. Good, careful follow-up.

    But the no-change conclusion drops the Azure finding from your first report, and that one looks real on current main: _execute_get_prompt_scores sizes its JSON batches from _MAX_BIND_VARS - 1 in shared code, Azure's _MAX_BIND_VARS is 2000, and each OR term carries two bound parameters under pyodbc (the JSON path repeats per term), so a full batch is ~3998 parameters against SQL Server's 2100 cap — get_prompt_scores with more than ~1050 IDs should fail there today, no cap change required. So instead of closing this as no-change, I'd like the small capped PR you originally sketched: bound json_batch_size to min(_MAX_BIND_VARS, 500) - 1 and add the >1000-ID get_prompt_scores regression test you suggested. SQLite behavior is untouched (its bound is already 499); the win is the Azure fix. No live Azure instance needed — the parameter arithmetic plus the regression test on SQLite covers it. The item stays open for that PR.

  17. romanlutz commented on Nov 19, 2026

    @romanlutz
    ContributorAuthor

    P311-25 accepted. I reproduced your visibility matrix exactly on a different platform (Windows, SQLite 3.50.4): backup 1/1, direct 1/0, staged 1/1 — direct deserialize genuinely breaks fresh-connection visibility on the shared-cache in-memory database, which rules it out for the sqlite_instance fixture, and the staged variant has no reason to beat plain backup(). The current template-backup reset in tests/unit/conftest.py stays. Checking the item off — thanks for the unusually reproducible write-up.

  18. romanlutz commented on Nov 21, 2026

    @romanlutz
    ContributorAuthor

    P311-07 closed as no-change after a maintainer-side sweep: every TypedDict/NamedTuple was enumerated and none has a payload field where a type parameter would preserve a real producer-consumer type relationship — the remaining Any/object fields are mixed-type by design. #4053's generic dataclass and the _AnalysisResult prior art already cover the genuine cases. Checking the item off. (One-liner spotted in passing: _ScoringEvidence.scorer_identifier can be annotated ComponentIdentifier | None — fine to ride along in any analytics change.)

  19. romanlutz commented on Nov 21, 2026

    @romanlutz
    ContributorAuthor

    P311-12 closed as no-change after a maintainer-side sweep: every group-producing path (message-send TaskGroup, scenario partial failures, attack-strategy groups, lifecycle shutdown) was traced to a handler that preserves all failures, and no site would benefit from except* — nothing peels subsets. The only residue is a theoretical mixed-group path in Copilot shielded cleanup with no realistic trigger; not worth a change. Checking the item off — #3983 covered the real gaps.

  20. romanlutz commented on Nov 21, 2026

    @romanlutz
    ContributorAuthor

    P311-23 closed as no-change after a maintainer-side sweep: all windowed computation already uses standard SQLAlchemy .over(...) (portable to Azure SQL), the one Python-side median in assert-policy metrics runs over hydrated objects with ordering semantics that don't fit SQL, and we've previously moved away from window ranking for performance (see the anti-join note in memory_interface). create_window_function is SQLite-only and would break backend parity for no measured benefit. Checking the item off.

  21. romanlutz commented on Nov 21, 2026

    @romanlutz
    ContributorAuthor

    P311-24 closed as no-change after a maintainer-side sweep: PyRIT keeps no BLOBs in SQLite — media bytes go to disk (DiskStorageIO) or Azure Blob Storage, already chunk-streamed, and the DB stores only paths; there are no binary columns in memory_models.py. blobopen has no target without a storage redesign the item explicitly rules out. Checking the item off.

  22. romanlutz commented on Nov 21, 2026

    @romanlutz
    ContributorAuthor

    Restructuring, final state of this tracker: 19 of 25 items are complete (checklist above), and the six still-open items have moved to dedicated issues, each with a maintainer-side scope assessment and candidate inventory:

    Claim on the dedicated issue by comment; the first commenter may open a PR. P311-07, P311-12, P311-23 and P311-24 are closed as no-change after maintainer-side sweeps (comments above). Pedro Holanda (@AoiUltramar): the capped fix requested earlier now lives in #4509, where you have first claim.

    Closing this tracker — it stays as the historical record. Thanks to everyone who worked through the checklist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions