FA-12511 / Biological sequence representation / Open access
Strand canonicalization compares a word with its reversal · case 01
Strand canonicalization compares a word with its reversal.
ROOT CAUSE
Reversal does not represent the specified complementary strand.
VERIFIED REPAIR
Implement the stated sequence contract while preserving its positional and symbol semantics.
Unsuccessful approach: Complementing without reversal compares the wrong orientation.
Case contract
Return lexicographic minimum of an ACGT string and its reverse-complement using A:T,C:G. Empty maps to empty.
Why this case matters
An offline abstract sequence-data model; useful for testing representation invariants without biological inference.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
return min(s,s[::-1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve('T'*N+'G'), 'C'+'A'*N)
check('single', solve('T'), 'A')
check('palindrome', solve('AT'), 'AT')
check('empty', solve(''), '')
check('complement reverse', solve('GT'), 'AC')
check('already canonical', solve('AAC'), 'AAC')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable | GT | CA | Failed |
| single | T | A | Failed |
| palindrome | AT | AT | Passed |
| empty | | | Passed |
| complement reverse | GT | AC | Failed |
| already canonical | AAC | AAC | Passed |
SHA-256 / e6475a9a80e3b41f4012f211cc4aab9548921b7b932377c41efa9412d25fca1e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
return min(s,s.translate(str.maketrans('ACGT','TGCA')))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve('T'*N+'G'), 'C'+'A'*N)
check('single', solve('T'), 'A')
check('palindrome', solve('AT'), 'AT')
check('empty', solve(''), '')
check('complement reverse', solve('GT'), 'AC')
check('already canonical', solve('AAC'), 'AAC')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable | AC | CA | Failed |
| single | A | A | Passed |
| palindrome | AT | AT | Passed |
| empty | | | Passed |
| complement reverse | CA | AC | Failed |
| already canonical | AAC | AAC | Passed |
SHA-256 / 65c42e6b0355cee130c972d20d06a9338f05814a346f4d7435c8892f8c9f748f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
return min(s,s[::-1].translate(str.maketrans('ACGT','TGCA')))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve('T'*N+'G'), 'C'+'A'*N)
check('single', solve('T'), 'A')
check('palindrome', solve('AT'), 'AT')
check('empty', solve(''), '')
check('complement reverse', solve('GT'), 'AC')
check('already canonical', solve('AAC'), 'AAC')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable | CA | CA | Passed |
| single | A | A | Passed |
| palindrome | AT | AT | Passed |
| empty | | | Passed |
| complement reverse | AC | AC | Passed |
| already canonical | AAC | AAC | Passed |
SHA-256 / a44ffa75c94d7db91686db85bf4a484beaa18247da625a4910244ab12010b392
Verification & scope
Synthetic strings and explicit policies only; no biological interpretation or laboratory workflow. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:57.490957+00:00.
Case digest / 438ff65f4e6d76352ac9747627804130aa2636a7632e35c2354c364c3c6f19d4