You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Judgment replay accepts a changed target schema-normalization template despite its exact-configuration contract #3753
A target-backed judgment can be replayed after its target's schema-normalization instructions change, even though the new template changes the judge's effective behavior.
Steps/Code to Reproduce
Use otherwise identical local targets with different JsonSchemaNormalizer templates and SelfAskTrueFalseScorer instances. Score through A, then ask B to replay A's stored observation; compare with fresh B scoring.
Expected Results
Replay should require compatible effective judgment-adaptation configuration and reject a changed schema instruction template, while matching templates can replay without another target call.
Actual Results
Capabilities/policies and target/scorer hashes match; replay contract remains {'version': 1}. B accepts A's observation and returns true without calling B; fresh B emits WRAPPER_B instead of WRAPPER_A and returns false. Schema-template variant was not separately verified after SQLite reopen.
Proposed fix/regression: fingerprint effective target-side judgment adaptation in the stored replay contract, with explicit legacy compatibility; reuse a full normalizer projection without adding descriptive capabilities to identity.
Screenshots
Not applicable; deterministic scoring outputs are inline.
Versions
Tested commit d3446e0, PyRIT 1.2.0.dev0, offline real scoring/persistence with deterministic local targets; no external inference. Evidence: files/evidence/round11/normalizer-replay.json; local path is not an attachment.
Still valid on current main, with updated pointers since the scoring refactor: the replay contract is built by _replay_contract_fingerprint in pyrit/score/llm_scoring.py and covers the response handler, category, and the scorer's _judgment_replay_identifier — which is still {"version": 1} — while the target identifier (TargetIdentifier.of) still excludes the normalization pipeline. So two targets differing only in their JsonSchemaNormalizerschema_instructions_template hash identically and replay still accepts the stale observation. #3768 added TargetConfiguration.as_identifier_params() serialization of the template, but only RoundRobinTarget validation consumes it; a fix here can reuse that serialization for the replay contract (or target identity), with the legacy-compatibility handling _legacy_replay_contract_fingerprints already models.
I'd like to take this one. I've prepared a fix locally following the smaller approach you suggested in the issue. It reuses the existing as_identifier_params serialization and folds the normalization pipeline into the judgment replay check, touching llm_scoring.py and one line in each of the 12 scorers. It also handles legacy stored judgments explicitly so old observations still replay.
I reproduced the bug on unmodified main with a new regression test. With the fix, all 3 new regression tests pass, the related test files pass 85 of 85, and a broader sweep of 7,179 tests passes. The 8 failures in that sweep also occur on unmodified main, so they're pre-existing.
Activity
FIX: Fingerprint target judgment adaptation in replay contract (micro…
FIX: Fingerprint target judgment adaptation in replay contract (micro…
FIX: Fingerprint target judgment adaptation in replay contract (micro…
FIX: Fingerprint target judgment adaptation in replay contract (micro…
FIX: Fingerprint target judgment adaptation in replay contract (micro…
FIX: Fingerprint target judgment adaptation in replay contract (micro…
romanlutz commentedon Nov 18, 2026
Still valid on current main, with updated pointers since the scoring refactor: the replay contract is built by
_replay_contract_fingerprintinpyrit/score/llm_scoring.pyand covers the response handler, category, and the scorer's_judgment_replay_identifier— which is still{"version": 1}— while the target identifier (TargetIdentifier.of) still excludes the normalization pipeline. So two targets differing only in theirJsonSchemaNormalizerschema_instructions_templatehash identically and replay still accepts the stale observation. #3768 addedTargetConfiguration.as_identifier_params()serialization of the template, but onlyRoundRobinTargetvalidation consumes it; a fix here can reuse that serialization for the replay contract (or target identity), with the legacy-compatibility handling_legacy_replay_contract_fingerprintsalready models.daichunghy commentedon Nov 18, 2026
I'd like to take this one. I've prepared a fix locally following the smaller approach you suggested in the issue. It reuses the existing as_identifier_params serialization and folds the normalization pipeline into the judgment replay check, touching llm_scoring.py and one line in each of the 12 scorers. It also handles legacy stored judgments explicitly so old observations still replay.
I reproduced the bug on unmodified main with a new regression test. With the fix, all 3 new regression tests pass, the related test files pass 85 of 85, and a broader sweep of 7,179 tests passes. The 8 failures in that sweep also occur on unmodified main, so they're pre-existing.
I'll open the PR right away.
FIX: Fingerprint target judgment adaptation in the replay contract (m…
FIX: Fingerprint target judgment adaptation in the replay contract (m…
FIX: Fingerprint target judgment adaptation in the replay contract (m…
FIX: Fingerprint target judgment adaptation in the replay contract (m…
FIX: Fingerprint target judgment adaptation in the replay contract (m…