Repository navigation
Enforce design requirements and fix optimizer correctness - #3
Merged
Merged
Conversation
thomdehoog
marked this pull request as ready for review
October 11, 2026 12:08
thomdehoog
pushed a commit
that referenced
this pull request
Oct 11, 2026
…lean Follow-up to the #3 review. Three limitations it left behind. Violations lying wholly inside the fixed flanks were reported exactly like violations in the coding sequence, so pasting a vector context that contains a site you are avoiding in the insert -- the usual reason to avoid it -- produced "not a valid design" for a CDS that was already optimal, with nothing the optimizer or the user could do. Each criterion now splits its complete count into reachable and unreachable, exactly rather than by sampling: every region carries a fixed_context flag and every criterion a fixed_context_count. When the two counts match, the report and the CLI say the coding sequence meets the requirement and only the supplied context does not. Validity and the exit code are unchanged: the construct really does contain the site. The server now refuses protected codons without starting DNA, an out-of-range protected index, and a residue whose every codon is excluded, instead of accepting the job and failing in the worker thread. The construct length cap compared flank bases against input residues, so the limit it enforced depended on whether the caller pasted protein or DNA. It now compares bases with bases and names the figure. Verified against independent brute-force oracles: three-way agreement of counts across 400 random configurations is unchanged, and the unreachable count is confirmed invariant under re-encoding the CDS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wq3oxFtutXhnAgmzKztG9g
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.
A low weighted score previously could leave forbidden motifs in the output while the interface implied that all requirements had been met. Mandatory requirements now take priority over soft preferences, and an independent final validator returns explicit validity and unresolved regions. A bounded coordinated repair phase can escape single-codon traps without claiming that failed heuristic searches prove a design impossible.
The algorithm also now:
This is a 0.3.0 behavior change: motif avoidance is mandatory by default, splice screening defaults to none, and optimized sequences/scores may differ from earlier versions. The interface changes show validity accurately and account for construct coordinates.
Validation:
Repair remains a bounded heuristic. Validity applies to the configured sequence criteria; these checks do not establish experimental expression or replace thermodynamic RNA modelling.