Bring the recorded Genomic Intelligence fixtures to contract revision 16 - #99
Merged
bviggiano merged 3 commits intoSep 7, 2026
Conversation
…recorded shapes The fixtures at the top of this file are labelled shapes recorded from the live service, and they carried a data.input.sequence_length the service no longer returns. It was removed from the echo on all seven predict operations on 2026-09-03 (contract revision 13): it meant the scored window on expression and the submitted length everywhere else, duplicating meta.sequence_length on six operations and contradicting it on the seventh. Keeping it in a fixture that claims to be a recording invites the next reader to reach for it again, which is the bug 9625541 and c85c15a removed from the tools. No parser reads the echo, so no assertion moves: 57 passed, 9 skipped, same as before. The one place the key stays is the payload in test_parse_expression_takes_the_submitted_length_from_meta_not_the_echo, which exists to make meta and the echo disagree. That is still worth pinning -- data.input is additionalProperties: true and no contract pin covers it, so nothing stops the key returning, and an older recorded body still has it. Its docstring said the service carries the key today; it now says when it went and why the test keeps it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Tc2vgq9BQP1YAPYABu8b9
…ld echo
Follow-on to the fixture commit, same key and same reason.
_GOOD_DATA is the minimal envelope the transport and envelope-shape tests hand
back, and its data.input carried a sequence_length of 400. Nothing reads it:
no tool in this package touches data.input at all, and every assertion on that
payload is an identity check against the dict itself. It is now
{"sequence_name": "demo"}, which is what the service echoes for that
submission, so the payload no longer offers a reader a field the API does not
send.
The comment in test_gi_expression_benchmark said, in the present tense, that
data.input carries a sequence_length of its own holding the window. That has
been false since contract revision 13 on 2026-09-03. The two assertions it
explains are still exactly right, and are still the only place the submitted
length and the scored window can be told apart, so only the tense and the
consequence move: a reader of the echo now gets None rather than the window.
60 passed, 9 skipped, unchanged. ruff check and ruff format clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Tc2vgq9BQP1YAPYABu8b9
…ision 16
Revision 13 dropped data.input.sequence_length, which is what this branch
started as. Revision 16 (2026-09-06) went further: it dropped
submitted_sequence_length and scored_window from the expression echo, and made
every data.input a typed, closed object -- additionalProperties: false, all
fields required, and covered by the consumer contract pins for the first time.
Recorded against live PROD today:
promoter / splice / enhancer / chromatin / annotation {sequence_name}
expression {sequence_name, description, tss_index}
find_genes_and_predict_expression {sequence_name, description}
The client needed no change -- parse_expression_data already reads
meta.task_specific_counts.scored_window with no echo fallback, which is the
whole point of the earlier commits on this branch. What was stale was the
recorded bodies and the prose around them.
Two new tests, because a recorded fixture has nothing upstream keeping it
honest: a stale one describes a service that no longer exists and the client it
exercises goes on passing. test_recorded_input_echoes_carry_no_derived_key
sweeps all seven payloads for the three removed keys;
test_the_recorded_expression_echo_matches_the_published_shape pins the two
non-trivial shapes by set equality, so a re-added key fails too. Both verified
red by reintroducing scored_window into the expression echo.
Deliberately NOT touched: the adversarial payload in
test_parse_expression_takes_the_submitted_length_from_meta_not_the_echo, which
keeps all three removed keys and makes them disagree with meta on purpose. Its
value is that it does not match the current contract, and its docstring now
says so, because "fix the fixture to match the schema" is the obvious wrong
move for the next reader.
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.
The recorded Genomic Intelligence response fixtures describe a
data.inputecho the service no longer returns. This brings them to the current published contract and adds the guards that would have caught the drift.What changed upstream
data.inputis an echo of the request. Two contract revisions have narrowed it:data.input.sequence_length. It held the 9,198 bp scored window, not the submission, so for any locus longer than one window it disagreed withmeta.sequence_length— and reading it was a real defect found in review here.submitted_sequence_lengthandscored_windowfrom the expression echo, and made everydata.inputa typed, closed object:additionalProperties: false, all fields required, covered by the consumer contract pins for the first time.Recorded against the live service today:
data.input{sequence_name}{sequence_name, description, tss_index}{sequence_name, description}The derived numbers live in
meta, which is where they belong and where the published schema has always covered them:meta.sequence_lengthfor the submission,meta.task_specific_counts.scored_windowfor the window.What this PR does
No client change.
parse_expression_dataalready readsmeta.task_specific_countswith no echo fallback — that is what the first commits on this branch established. What was stale was the recorded bodies and the prose around them.test_recorded_input_echoes_carry_no_derived_keysweeps all seven payloads for the three removed keys;test_the_recorded_expression_echo_matches_the_published_shapepins the two non-trivial shapes by set equality, so a re-added key fails too. Both verified red by reintroducingscored_windowinto the expression echo.One fixture is deliberately left wrong.
test_parse_expression_takes_the_submitted_length_from_meta_not_the_echokeeps all three removed keys and makes them disagree withmetaon purpose, so that a reader drifting back to the echo fails here rather than in a user's report. Its docstring now says so explicitly, because "make the fixture match the schema" is the obvious wrong move for the next person.Verification
62 passed, 2 skippedontests/sequence_scoring_tests/test_genomic_intelligence.py(the 2 skips are the--integrationtests). The live integration test that distinguishes submitted length from scored window is unchanged and still asserts againstmeta.Nothing here is a behaviour change for users of the tool; it is fixture and test accuracy.