diff --git a/analyses/phase3_log.qmd b/analyses/phase3_log.qmd index a9dd39c3..60c6f6b7 100644 --- a/analyses/phase3_log.qmd +++ b/analyses/phase3_log.qmd @@ -5863,3 +5863,420 @@ largest threat to that reading is stated in the report itself — the FP arm is are not two populations and equal failure shares are the expected result. **Commit.** `PENDING` (the SHA is not knowable when this stanza is written; `main` takes no direct commits — corrected in the next step's PR, as P3-15′-f corrected P3-15′-e's). + +## Step P3-15′-f — 2026-08-12: what criterion (b)'s seven parameters are actually worth, and the choice they present + +**Inputs.** Both de-novo supplies, retrieved fresh by `rsync` and bound to the committed +reports by digest — the FP arm's 278 consensuses (`two.amlab:$HOME/tbox-scratch/round_p3_15_supply/msa`, +jobs 1205 + 1254, `90b2fe1b…`) and the matched control's 76 (`round_p3_15g_control/msa`, job +1264, `0b5afbec…`) — plus the three per-candidate spare-rule columns the round's conjunction +reads: criterion (a) from job 1205's merged status table (`3215f034…`, the digest +`architecture_parameter_measurement.json` already records), criterion (c) from P3-15′-c-ii +(`3c8ac8e3…`, the digest `synteny_exclusion_diagnostic.json` records), and P3-15′-b's 941 +Stage-2 posteriors. + +**Process.** `P3-15′-f`'s block asked for its recommendation to be **re-derived, not +re-quoted**, once the control landed. `mining/architecture_param_recommend.py` does that over +the **whole grid** rather than the six named tuples the two measurement reports carry: 3,840 +enumerated points, of which **2,880 are admissible** — admissibility *measured* by running the +shipped localizer and catching its refusal, not by re-encoding its guard, and the 960 refusals +are all one rule (`bulge_min_nt` shorter than `ncca_pairing_nt`). Each point is evaluated on +both arms through `candidate_state`, and its **round yield** through the shipped +`spare_rule.is_mining_excluded` — the real four-disjunct conjunction, not a re-derived one. The +three spare-rule columns are joined into a committed 941-row table so the arithmetic is +auditable without cluster access, the same reason `-g-iv` committed the control's status table. + +**Outputs.** `src/tbox_finder/mining/architecture_param_recommend.py` · +`reports/p3/architecture_parameter_recommendation.json` (`pins_nothing: true`) · +`data/processed/mining/round0_fp_spare_rule_inputs_v0.json` · +`tests/unit/test_architecture_param_recommend.py` (69 tests). + +**⚠⚠ The headline is not about (b) at all: the round's yield ceiling is 15 of 941, and it is +set before (b) is chosen.** Sparing is a disjunction, so mining is a conjunction. Criterion (a) +fails on **111** of 941 and criterion (c) on **96**; their intersection is **15**, and all 15 +have a consensus, so (b) is decidable on every one of them. Declaring the Stage-2 disjunct +lowers it further (**12** at threshold 0.5, **13** at 0.9/0.95/0.99). Over the entire admissible +grid the round mines between **1 and 13** candidates. Criterion (b)'s seven parameters are +therefore choosing among **single-digit differences in a re-mining round of 941 candidates** — +a fact no committed report stated, and one that changes what the §7 question is about. + +**The decision rule is stated before the counts, and the counts are then allowed to check it.** +Four floors are read off ADR-0006 D3's own wording and ADR-0004 D1's element vocabulary — +`min_named_helices ≥ 2` (D3 says "the expected helices", plural, of four named elements), +`min_helix_pairs ≥ 2` (one base pair is not a helix), `ncca_pairing_nt ≥ 2` (D3 says +*pairing*), and a bounded `bulge_max_nt` (10,000 is the axis's no-filter sentinel). Among the +**864** survivors the rule takes the **most permissive as measured**, which is ADR-0006 A4's own +fail-closed argument for a sparing disjunct. That selects `stem_i_nt_threshold=1`, +`min_named_helices=2`, `min_helix_pairs=2`, `bulge_min_nt=2`, `bulge_max_nt=50`, +`ncca_pairing_nt=2`, `allow_wobble=0` — **exactly `sensitive_core`**, tied only with its +`allow_wobble=1` twin, which is the inertness proof reappearing as a measurement. + +**Two of the four floors are load-bearing in the strongest sense.** Dropping +`min_named_helices ≥ 2` or `min_helix_pairs ≥ 2` alone leaves the rule **unable to decide** (4 +and 2 settings respectively tie at the measured minimum and the tie-break cannot separate them), +which is reported as a refusal rather than resolved by enumeration order. Dropping +`ncca_pairing_nt ≥ 2` moves the selection to `ncca=1, bulge_min=1`. Dropping the bounded-bulge +floor changes nothing — the tie-break already prefers the bounded value, and the two measure +identically, so that floor is semantic only and the report says so. + +**⚠ The composite (a) ∧ (b) is ANTI-selective at the strict end, which the per-criterion +comparison could not show.** `-g-iv` compared (b)'s own failure share and found no separation. +The quantity that decides what is mined is the conjunction, and there the control falls through +**more** often than the FP arm at five of the six named settings: 9.2 % vs 7.2 % +(`loosest_nonvacuous`), 10.5 % vs 11.5 % (`sensitive_core` — the one setting favouring the FP +arm), 38.2 % vs 23.7 %, 43.4 % vs 32.0 %, 57.9 % vs 37.4 %, 59.2 % vs 38.5 %. At +`curated_freeze_transplant` and `strictest` the two 95 % Wilson intervals are **disjoint**. The +mechanism is that criterion (a) passes 39.5 % of the control against 60.1 % of the FP arm, so +tightening (b) removes protection from a population (a) was already protecting less. + +**The trade, in the units the choice is actually made in.** Round yield vs control records +losing both (a) and (b), of 68 producible: `sensitive_core` **3 mined / 8 records**; +`canonical_core_3helix` **11 / 26**; `canonical_core_3helix_ncca3` **11 / 29**; +`curated_freeze_transplant` and `strictest` **13 / 38**. Buying ten more hard negatives costs +thirty more known-T-box records their model-independent protection. + +**⚠ The report enumerates the settings that beat its own recommendation.** Eight floor-clearing +points mine more at no greater measured control cost — at most **two** extra candidates (yield 5 +at the same 8/68). They are listed rather than left to be found, and declined for a stated +reason: they are argmins over 2,880 points against 68 records, the damage coordinate they tie on +**excludes criterion (c)** entirely (the control's hosts are unannotated), and A4 asks a round to +supply a *chosen* value, not a tuned one. + +**⚠ A number in `imp.md` was wrong and is corrected here — `TODO.md` had it right.** Criterion +(c)'s status table is **546 passed / 96 failed / 299 unavailable**, which is what `TODO.md`'s +P3-15′-c-ii entry and the committed `synteny_exclusion_diagnostic.json` both say +(`n_candidates_passing: 546`, `n_unavailable: 299`). `imp.md`'s block carried **541 / 101 / 299** +— the *pre-fix* count that appears two sentences later in that same block as the defect it +describes; I briefed a subagent off that stale line and it flagged the disagreement. The ceiling +of 15 is computed from the shipped table, never from either file's prose. + +**⚠ One column of the join is not anchored to any committed report, and is carried as a +sensitivity only.** No committed artifact records the Stage-2 posteriors' digest, and a **second +scoring of the same 941 candidates exists** whose values differ by up to 3.8e-2 — a CUDA forward +is not bit-reproducible. The two agree on every candidate at thresholds 0.5/0.9/0.95 and +disagree on 3 at 0.99. No headline number rests on that column: the ceiling of 15 uses (a) and +(c) alone, both digest-anchored. + +**⚠ A defect downstream of this step, verified not inferred.** `slurm/p3/stage1_remine.sbatch` +builds `--relaxed-arch-available` / `--synteny-available` into `$PLAN_FLAGS` and passes them to +`apply-spare-rule`, but **never passes `--relaxed-arch-status` or `--synteny-status`** (the +strings do not occur in the file). `remine.py:512` raises on exactly that pair, so a round +declaring either backend live dies at leg (1). The producer run this step gates would therefore +produce a status table with no path into the round until that sbatch is fixed — off this step's +roadmap, reported not patched. + +**Validation.** `tests/unit` + `tests/golden` vs a matched `main` baseline at `090547f`: **zero +new failures** — worktree **13** FAILED, main **26**, a strict subset. The delta is the +documented DVC/LFS one: 9 `test_selection_val` + 4 `test_coverage_sim` move FAILED → SKIPPED, +and one further test (`test_committed_table_hash_link_resolves_to_the_live_corpus`) skips in the +worktree because `master_clean_v0.parquet` is not materialised there; both `^FAILED` sets are +ANSI-stripped and cross-checked against the summary line, and the skip-reason diff names the +extra one rather than absorbing it into a count. **40 sabotages, all RED against their NAMED +test, plus 2 negative controls that stay green**; the harness rewrites the original bytes (the +module is untracked, so `git checkout --` would be a silent no-op), clears `__pycache__` around +every run and re-reads `git status --porcelain` before and after each. Both artifacts re-derive +byte-identically apart from `generated_at_utc`. `ruff` + `black` clean. + +**Decisions.** ⚠ **Two of this step's own defects were caught by its harness, not by review.** +A sabotage of `clears_all_floors` stayed **green** because `apply_decision_rule` filtered with +its own inline copy of the same condition — two spellings of "clears every floor" that could +drift apart while the frontier and the recommendation disagreed +([[fixed-one-of-two-identical-things]]); the selection now routes through the one function. +And `floor_sensitivity` reported `measured_identically_to_the_chosen_setting: true` when the +selection had not moved — comparing the chosen setting with itself, a TRUE that could not be +FALSE ([[clauses-must-guard-emptiness]]); it is `null` now. The §7 seven-parameter choice +remains **open and is the user's**; this step pins nothing and amends no ADR (A4 already +delegates the value to the round). **Commit.** `PENDING` (the SHA is not knowable when this +stanza is written; `main` takes no direct commits — corrected in the next step's PR, as this +step corrects P3-15′-g-iv's). + +**Review round 1 (CodeRabbit CLI, 2 minor, both real, both fixed).** (1) The bounded-bulge +floor's rationale cross-referenced `recommendation.floor_sensitivity` for the claim that the +bound costs nothing — and that field is `null` in exactly this case, because dropping the floor +does not move the selection. The citation pointed at the one place it could not be read. A +`bulge_sentinel_comparison` block now measures the chosen setting against its own +`bulge_max_nt = 10000` twin directly (identical on all four counts: fp_failed 52, mined 3, +records losing (b) 9, records losing (a) ∧ (b) 8) and the rationale cites that. +(2) `control_damage` divided by `n_producible` and called `wilson_interval` on it without a +guard, so a control with no producible record raised `SizingError`/`ZeroDivisionError` rather +than this module's own refusal — while `anti_selectivity` already guarded the same degenerate +input. Both now refuse by name. Sabotage count 40 → **44**, all RED against their named test. + +**Review round 2 (CodeRabbit GitHub app, 5 findings — 2 duplicating the CLI's, 3 new, all +real, all fixed).** (1) **The tie refusal covered three of the seven parameters.** It fired only +when two argmin members shared a `_tie_break_key`, so two settings differing in *both* +`min_helix_pairs` and `bulge_max_nt` had different keys and were separated by `bulge_max_nt` +alone — publishing a `min_helix_pairs` the rule never chose, in direct contradiction of step (4) +of its own stated statement. The refusal now tests whether the tied settings disagree on any +parameter **outside** `TIE_BREAK_VOCABULARY`, which is derived from `TIE_BREAK_ORDER` rather +than restated. ⚠ The recommendation, the ceiling and the frontier are **unchanged** — the only +movement in the regenerated report is that `floor_sensitivity` now reports **3** and **7** tied +settings where it had reported 2 and 4, i.e. the old check had been silently resolving ties it +should have refused. (2) **A duplicated manifest `candidate_id` was never refused**: every +corpus size here is a row count while every join is a set, so a duplicate inflates the +denominator while the coverage check still reads as exact. Refused now at both sites. (3) +**`stage2_posterior` accepted `bool`** — `bool` subclasses `int`, so `true` reads as 1.0 and +*spares* the candidate at every threshold — **and accepted values outside [0, 1]**, so a +mis-scaled column would clear every threshold silently. Both refused. Sabotages 44 → **49**. + +**⚠⚠ Review round 3 (a 5-lens adversarial workflow + Greptile + a second CodeRabbit pass) BROKE +TWO OF THIS STEP'S OWN PUBLISHED CLAIMS.** Both are corrected above rather than hedged, and the +corrections are the most important content of this step. + +**(1) The FP arm is pseudo-replicated too, and the report said the opposite.** Of the 278 +(a)-decided FP candidates only **199 are distinct loci**: 79 loci contribute two candidate ids +differing solely in the tiling-window offset, and those pairs have **byte-identical `msa.sto`**, +identical (a) status (230/230 concordant), identical (c) status, and identical (b) verdicts at +every named setting — verified here, not taken on report. The old `unit_caveat` asserted the +asymmetry backwards ("the control's unit is a QUERY (pseudo-replicated) and the FP arm's is a +candidate"), so every FP interval was too narrow while the control was refused one for exactly +the property the FP arm also had. `locus_of` now collapses the window offset and every FP +interval is on **n = 199 loci**. + +**(2) "Disjoint 95 % Wilson intervals at the two strictest" does not survive the correction.** +That claim was computed from a **query-level** control interval — the interval `control_damage` +itself refuses to publish — against a candidate-level FP one. Restated on the units the module +says it uses (control **records**, n = 68; FP **loci**, n = 199): `loosest_nonvacuous` 0.103 +[0.051, 0.198] vs 0.075 [0.046, 0.121] · `sensitive_core` 0.118 vs 0.126 · `canonical_core_3helix` +0.382 [0.276, 0.501] vs 0.241 [0.187, 0.305] · `…_ncca3` 0.426 vs 0.322 · `curated_freeze_transplant` +0.559 [0.441, 0.671] vs 0.377 [0.312, 0.446] · `strictest` 0.559 vs 0.392. The control still falls +through **more** at five of the six settings — the direction is unchanged and it is the reading +that matters — but **no setting has disjoint intervals**. The separation claim is withdrawn. + +**⚠⚠ AND THE LEVEL OF THE FIRST FLOOR WAS NEVER MINE TO SET.** The floor `min_named_helices >= 2` +was justified as D3's "expected helices" being plural. A second reading is stated **by this +repo's own localizer** — `architecture.named_elements_present`'s docstring reads D3 as *"the +canonical class-I core is Stem I + Stem III + antiterminator (with Stem II in many lineages)"*, +i.e. **three** — and D3 itself contains no number, assigning the value to the held-out canonical +set at P6. Pricing the levels changes the headline four-fold, so the report now runs the entire +rule at **every** level and publishes each answer: **≥1** the rule refuses to decide · **≥2** → +`sensitive_core`, 3 mined / 8 of 68 records · **≥3** → `mnh3 · mhp2 · bulge 2–50 · ncca2`, **11 +mined / 24 of 68** · **≥4** → `mnh4 · mhp2 · bulge 2–20 · ncca2`, **13 mined / 31 of 68**. The +level is a §7 choice and this step does not take it. + +**Three further real findings, fixed.** The `min_helix_pairs` floor cited ADR-0006 D3 for a +concept D3 does not contain — its `source` now says it is an **assumption of this module**, and +the stack-depth distribution its rationale appeals to is carried in the report so the claim is +checkable where it is made. `control_records` derived the record grouping by splitting the +candidate-id string, which `record_of`'s own docstring forbids; it now reads `accession` from the +manifest through the shipped `load_control_records` and refuses a status table that is a +different corpus. And a `supply_origin` copied out of either measurement report reached the +public payload **without** the `is_local_path_shaped` guard the `--supply-origin` flag gets +(Greptile P2) — the guard was on the argument, not on the field. + +**⚠ WHAT DID NOT CHANGE, AND WHY THAT MATTERS.** The **yield ceiling of 15**, the 1–13 range over +the grid, the `sensitive_core` selection at level 2, and the whole frontier are **untouched** by +all six corrections: they are counts of candidates and loci, not intervals, and none of them +rested on the two broken claims. + +**Validation (final).** 98 unit tests; **62 sabotages, all RED against their NAMED test**, plus 2 +green negative controls. ⚠ Two sabotages initially stayed **green** and both were my test +targeting, not the code: the locus-counting sabotage was pointed at an end-to-end test that +asserts nothing about loci, and the `control_records` sabotage still tripped a *different* +refusal in its named test. A dedicated locus test and a retarget fixed both — a sabotage that +passes for the wrong reason is worth exactly nothing. Zero new failures vs the matched `main` +baseline at `090547f` (worktree **13**, main **26**, a strict subset). The report re-derives +byte-identically apart from `generated_at_utc`. `ruff` + `black` clean. + +**Review round 4 — the 5-lens workflow's full return (38 agents, 0 errors), and three more real +corrections.** Its top confirmed finding was a **coverage** one and it landed on code this step +had just written: `evaluate_point`'s `fp_with_a` — the entire FP numerator of the +anti-selectivity reading — was reachable by only one fixture, and that fixture set criterion (a) +to `failed` on **every** candidate, so dropping the (a) conjunct, or reading `synteny_status` +instead, left the suite green while the published claim went from "5 of 6" to "1 of 6" or was +silently *strengthened* to "6 of 6". The locus test now uses an **asymmetric** corpus — a third +candidate that fails (b) but passes (a) — so all three implementations give different numbers, +and both mutations are in the sabotage set. + +**⚠ THE CEILING IS 15 MANIFEST ROWS BUT 12 DISTINCT LOCI.** The same tiling duplication that +broke the FP intervals also inflates the ceiling: three of the fifteen rows are second calls on a +locus already counted. Every yield in the report now carries both units, and the recommendation's +3 mined rows are 3 distinct loci. + +**`build_inputs` was asserting provenance it had not checked.** Its `anchored_by` strings — +"report X records this digest" — were unconditional constants that would keep asserting the +anchor after either file changed. `anchor_of` now reads the named report, compares the digest, +and returns `None` when it does not match; on this run the (a) and (c) columns verify and the +Stage-2 column stays honestly unanchored. Two more identities are relabelled rather than +published as measurements: `min_mined_if_b_passed_everywhere` is 0 by the structure of the rule, +not by measurement, and the report says so. + +**Validation (final).** 104 unit tests; **69 sabotages, all RED against their NAMED test**, plus +2 green negative controls. Zero new failures vs the matched `main` baseline at `090547f` +(worktree **13**, main **26**, a strict subset). The report re-derives byte-identically apart +from `generated_at_utc`; `ruff` + `black` clean. + +**⚠ WHAT IS STILL OPEN FROM THE REVIEW, DISCLOSED NOT FIXED.** The workflow raised further items +this step does not close: `frontier` attaches a nominal Wilson interval to a minimum selected +over up to ~1,000 grid points (a selection effect, not a coverage statement); the control's +damage share is conditioned on producibility and so is a rate on the 68 producible records, not +on the 160 drawn; and the comparison report is carried into the payload as prose without a digest +binding. None changes a number above; each is a caveat on how a number may be read, and they are +listed here rather than left in a transcript. + +**⛔ THE §7 DECISION, TAKEN 2026-08-12 (user, AskUserQuestion): `min_named_helices` LEVEL 2 ⇒ +`sensitive_core`.** The round will supply `STEM_I_NT_THRESHOLD=1 · MIN_NAMED_HELICES=2 · +MIN_HELIX_PAIRS=2 · BULGE_MIN_NT=2 · BULGE_MAX_NT=50 · NCCA_PAIRING_NT=2 · ALLOW_WOBBLE=0`. +Presented against the canonical-core reading (level 3: 11 mined / 24 of 68 records), level 4 +(13 / 31) and the option of not running the producer at all given the ceiling. The choice takes +the **plural** reading of D3 and the most permissive non-vacuous setting on the grid, which is +ADR-0006 A4's own fail-closed direction for a *sparing* disjunct: at a ceiling of ~12 distinct +loci the yield forgone is a handful of candidates, while the protection kept is on the flagship +class. **No ADR is amended** — A4 already delegates the value to the round, which records it in +provenance, and D6/D17's P6 freeze is untouched. The expected round yield is **3 mined** and the +measured cost is **8 of 68** control records losing both model-independent protections. ⏭ The +**§9.3 submit-ack** is now the only thing between this step and the `architecture_producer` run, +and `slurm/p3/stage1_remine.sbatch`'s missing `--relaxed-arch-status` must be fixed before P3-15 +itself can consume what that run writes. + +**Review round 5 (CodeRabbit CLI, 1 major, real, fixed) — the writer had none of the reader's +validation.** `load_spare_rule_inputs` refuses a `bool` posterior and an out-of-range one, but +`build_inputs` — the command that *writes the committed table* — wrote `float(post[cid])` and +`str(cov[cid])` with no checks at all. `float(True)` is `1.0`, so a `true` in the source column +would be committed as a number that is not a posterior, clears every threshold in the Stage-2 +band, **spares** the candidate, and is thereafter invisible to the loader because by then the +column really is a float. The guard ran on the *next* command, after the artifact existed +([[guard-runs-after-what-it-guards]]). Both rules are now single functions — `checked_status` +and `checked_posterior` — called by the writer **and** the reader, so the two cannot drift; the +suggested patch would have added a second copy beside the first. Six tests added (**110**), two +sabotages (**71**), and the committed table re-derives to the **identical sha256**, so nothing +in the current artifact was affected. + +**Review round 6 (CodeRabbit GitHub app, 2 minor, both real, both fixed).** `locus_of` refused +*fewer* than four colon-separated fields but accepted **more** — a five-field id would have +dropped its middle fields and merged into another candidate's locus, shrinking every locus +denominator with no refusal, which is exactly the failure `control_records` refuses for the +record grouping. It now demands the shape exactly. And the tie refusal computed its "axes the +tie-break cannot speak to" with a **symmetric** difference: today every `TIE_BREAK_ORDER` name is +also a `ParamTuple` field so the two agree, but renaming or adding a non-parameter entry would +put that name into `undecidable` and raise `KeyError` **inside the guard that exists to stop an +undecided selection being published**. It is a plain set difference now. The report re-derives +unchanged. **112 tests, 73 sabotages.** + +**Review round 7 (CodeRabbit CLI, 2 minor, both real, both fixed) — a two-shape reader that only +ever read one shape, and a test whose name promised the branch it did not assert.** (1) Both +manifest call sites read `manifest.get("candidates", manifest)`, written to accept either an +object carrying a `candidates` list *or* the rows themselves; the second shape never worked, +because a top-level JSON list has no `.get`, and `AttributeError` is outside `main`'s +`(RecommendError, ValueError, TypeError, OSError, KeyError)` — so a shape the code advertised +ended the CLI in a traceback instead of the `refused:` path. A JSON **object without +`candidates`** was worse: it fell back to the mapping and iterated its *keys*. One +`read_manifest_ids` now serves both sites ([[fixed-one-of-two-identical-things]] — two call +sites, and a fix to one would have left the other), refusing the shape, a non-object row (the +producer's own reader *drops* one, which here would silently shrink the 941 denominator the +coverage check and the ceiling are computed against) and a row carrying neither id key — +`candidate_id_of` raises `ProducerError`, a `RuntimeError`, which escapes the refusal path just +as the shape errors did. On the real manifest the new reader returns the **identical 941 ids**, +so no number in this report moves. (2) `floor_sensitivity`'s +`measured_identically_to_the_chosen_setting` is three-valued, and the test named for its **True** +branch asserted **False** — the twin it built was strictly more permissive, so it won on the +metric and the field could not be True. The test is renamed for what it asserts, and the True +branch now has its own: reached through the bulge floor, the one floor whose parameter is in the +tie-break vocabulary, where the sentinel twin is inadmissible until the floor is dropped and then +ties on every measured coordinate. That branch had no test at all — on the shipped grid the field +takes only `null` and `False` ([[clauses-must-guard-emptiness]]). **124 tests, 81 sabotages, all +RED against their NAMED test.** Zero new failures vs the matched `main` baseline at `090547f` +(worktree **13**, main **26**, a strict subset); `ruff` + `black` clean. + +**Review round 8 (CodeRabbit CLI, 5 findings — 4 major, 1 minor, all real, all fixed) — and one +of them closes an item this step had been carrying as *disclosed, not fixed*.** (1) **The +carried-forward comparison headline is now bound to the supplies.** The payload's +`arms.comparison_headline_carried_forward` copies a *reading* of the two arms out of the +control-comparison report, whose +provenance hash identifies the file and not its subject; both measurement reports were already +digest-bound here and this one was not, so a comparison of a different pair of arms could be +quoted beside numbers derived from these two ([[gate-must-bind-to-upstream-evidence]]). The +report records `arms.fp` / `arms.control` supply digests, and they equal the two measurement +reports' — `90b2fe1b…` and `0b5afbec…` — so the binding holds on the shipped artifacts. An +**absent** digest is refused as well as a disagreeing one: a comparison that records none binds +nothing, and reading that as agreement is the vacuous TRUE this project keeps meeting. (2) **The +control's status VALUES were never checked.** `control_records` validated the id set only, while +`control_damage` reads producibility as `status[q] in DECIDED_STATES` — so a typo, a null or a +number silently removes that query from the 68-record denominator every share and interval on +this arm is computed against. The FP arm's two columns pass through `checked_status` in both the +writer and the reader; this arm did not, and the asymmetric guard is the one that gets forgotten. +(The reachable case was already refused downstream by `assert_supply_is_the_decided_set`, which +would see the id leave the decided set while its consensus sat on disk — but that guard is about +the supply and names a different cause.) (3) `assert_supply_is_the_decided_set` compared +`set(supply_ids)`, so a supply naming one candidate twice merged into an exact-looking equality +while every per-item loop still saw both rows ([[duplicate-key-merges-instead-of-colliding]]); +the ids are materialised and the repeat refused. Neither shipped call site can produce one today +— both derive ids from a slug→id index over unique directories — so this refuses a shape the +contract forbids rather than one observed. (4) `checked_posterior` called `float(value)`, and a +JSON integer beyond float range raises **OverflowError**, an `ArithmeticError` outside `main`'s +except tuple: a traceback where every other malformed posterior gets `refused:`. (`1e400` parses +to `inf` instead and the range test already caught it — that is the branch's positive control.) +(5) A dead `if False` operand in the grid-distinctness assertion is removed; it also read a +`label` key `as_dict()` does not carry, so removing the guard would have raised `KeyError`. +**135 tests, 88 sabotages, all RED against their NAMED test**, including two positive controls +(a status guard that refuses everything, and a grid whose points collide in *value* with the +count preserved). Zero new failures vs the same `main` baseline; `ruff` + `black` clean; no +committed artifact changes. + +**Review round 9 (CodeRabbit CLI, 3 findings — 1 major, 2 minor, all real, all fixed), two of +them on code round 8 had just written.** (1) **The slug indexes merged a collision instead of +refusing it.** `slug → candidate_id` was a dict comprehension for both arms, so two ids landing +on one slug kept only the last: the consensus measured for that slug would be attributed to one +candidate and the other would leave `arch_by_id` silently, every yield count still reconciling — +the shape this module refuses for manifest ids and, since round 8, for supply ids. The orphan +check downstream cannot see it, because it only finds slugs with *no* candidate. ⚠ Two DISTINCT +ids cannot collide by construction — `covariation_producer.candidate_slug` appends a 12-hex +digest of the exact id for exactly this reason — so the guard states a contract, and the test +triggers it the one reachable way, with a repeated id. (2) Round 8's new status-value refusal +printed the **manifest's** path as the location of a bad **status** value, sending a reader to a +file whose contents are fine; `control_records` now takes the status path. ⚠ And the sabotage +that mattered was not the helper's: dropping `status_path=` at the call site left the whole +suite **green**, because a keyword-only argument with a default is droppable in silence — so the +test that pins it asserts the refusal names `ctrl_status.json`, from `recommend`, not from the +helper ([[artifact-pinning-test-cannot-see-the-code]]). (3) A `pytest.raises(Exception, …)` in an +older test accepted an `AttributeError` or a `KeyError` as readily as the refusal it meant to +pin; it names `RecommendError`/`CompareError` now. **139 tests, 92 sabotages, all RED against +their NAMED test.** Zero new failures vs the same `main` baseline; `ruff` + `black` clean; no +committed artifact changes. + +**Round 10 came back clean — and a 4-lens adversarial pass (27 agents, 0 errors) then found +twenty things it had not, seventeen of them in the SAME two families.** The CodeRabbit CLI +returned *No new findings* on `b521cdc`, which is the §5.1 gate; the harness was run anyway, +because rounds 7–9 had each found real defects in code the previous round had just written. Three +of its twenty-three candidates were refuted by their own verifiers and are not carried. + +**Family 1 — the refusal path, five more escapes of the kind round 7 closed for the manifest.** +`report.get("supply", {}).get(…)`, `comparison.get("headline", {}).get("reading")` and +`(fp_report.get("helix_arm") or {}).get(…)` all substitute their default **only when the key is +absent**: a present-but-not-an-object value — a string, a list, a number — sails through and the +next `.get` raises `AttributeError`, outside `main`'s except tuple. ⚠ The `headline` one is the +sharpest: round 8 bound the comparison report's `arms` **and left the field that guard exists to +protect unchecked**, so a comparison whose digests match perfectly and whose headline is a bare +string killed the CLI in a traceback. `read_json_object` + `object_field` now serve every one of +them (absent stays permissive — several blocks are genuinely optional — while a wrong *shape* is +named), and the control status table is shape-checked **before** `index_by_slug` consumes it, +twelve lines ahead of `control_records`' own refusal ([[guard-runs-after-what-it-guards]]). + +**Family 2 — nine published numbers that no sabotage could reach.** Each of these mutations left +all 139 tests green: `all(` → `any(` on the **record-level (a)∧(b) damage rule** — the rule behind +the *8 of 68* figure the §7 choice was made against; dropping the `(a)` conjunct from the +query-level count, which silently republishes the (b)-only count; `len(producible)` → `len(queries)` +in the query denominator; each share divided by the *other* numerator; the two Wilson intervals +**swapped**; `frontier`'s per-yield argmin replaced by keep-the-last-seen; `share_failed_of_decided` +divided by `fp_passed`; the locus collapse in `mined_loci_by_threshold`; and the floors conjunct in +`dominating_alternatives`. The cause was uniform and is the one this file's own header names: every +control fixture was **symmetric** — `point()` set `n_records_losing_a_and_b` and `n_records_losing_b` +to the same value, and every `control_damage` fixture made each record uniform in its per-query +verdict, so ALL was indistinguishable from ANY and (a)∧(b) from (b) alone. One asymmetric corpus +now carries six quantities no two of which are equal, `point()`'s two record counts differ by +default, and the intervals are pinned **by identity** to their own numerators — a containment +assertion passed with them swapped, because at n = 3 each interval contains the other's point +estimate ([[symmetric-count-fixture-blind-to-inversion]]). Two guard **call sites** in `recommend` +— the control decided-set check and the supply/manifest orphan check — were also deletable in +silence, and are now driven through `recommend` itself. **156 tests, 105 sabotages, all RED against +their NAMED test.** No published number moves: the committed manifest still reads 941 ids and no +artifact changed. Zero new failures vs the same `main` baseline; `ruff` + `black` clean. + +**Rounds 11 and 12 (CodeRabbit CLI, 1 minor each, both real, both fixed) — both on the tests the +round above added, and both about a name.** (1) The asymmetric fixture's summary line was corrected +to *4 decided queries of 5* when its expectation was fixed, while the record-B bullet still read +*(3) of (4)*; four tests read that docstring as the statement of what they expect. (2) A test named +for a `null` supply block supplied the string `"cluster"`. The two are not the same input: `null` +takes `object_field`'s permissive branch, so the **digest** gate refuses it, not the shape gate. +The scalar case keeps the shape assertion under a name that matches it, and the `null` case is +added under the guard that actually fires. **157 tests.** diff --git a/data/processed/mining/round0_fp_spare_rule_inputs_v0.json b/data/processed/mining/round0_fp_spare_rule_inputs_v0.json new file mode 100644 index 00000000..fddf1315 --- /dev/null +++ b/data/processed/mining/round0_fp_spare_rule_inputs_v0.json @@ -0,0 +1,5675 @@ +{ + "adr": "ADR-0006 D3 (criterion (b)'s named-element predicate), D6 (the short-Stem-I relaxation), A4 (the seven rule parameters supplied per round, no defaults); ADR-0005 D14 (the spare rule: sparing is a disjunction, so mining is a conjunction; unavailable spares); ADR-0004 D1 (the element vocabulary D3 reuses)", + "n_candidates": 941, + "rows": [ + { + "candidate_id": "GCA_001873345.1:c106:15360:15821-15979", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988352669252479, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_001873345.1:c106:15360:16034-16111", + "covariation_status": "passed", + "stage2_posterior": 0.0005890783185097332, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_001873345.1:c106:15872:16034-16091", + "covariation_status": "unavailable", + "stage2_posterior": 0.013560228684075281, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_001873345.1:c10:3072:3515-3599", + "covariation_status": "unavailable", + "stage2_posterior": 0.006463578589177299, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_001873345.1:c10:3072:3623-3722", + "covariation_status": "unavailable", + "stage2_posterior": 2.4995419238409126e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_001873345.1:c125:5632:6292-6383", + "covariation_status": "failed", + "stage2_posterior": 0.3893773616304835, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_001873345.1:c125:5632:6403-6539", + "covariation_status": "unavailable", + "stage2_posterior": 0.9196764235800321, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_001873345.1:c125:6144:6292-6383", + "covariation_status": "failed", + "stage2_posterior": 0.3893773616304835, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_001873345.1:c125:6144:6403-6539", + "covariation_status": "unavailable", + "stage2_posterior": 0.9196764235800321, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_001873345.1:c125:6301:6304-6383", + "covariation_status": "failed", + "stage2_posterior": 0.010432635629471807, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_001873345.1:c125:6301:6403-6533", + "covariation_status": "unavailable", + "stage2_posterior": 0.0013165766977983077, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_001873345.1:c128:2048:2396-2475", + "covariation_status": "passed", + "stage2_posterior": 4.796485631172163e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_001873345.1:c128:2048:2535-2685", + "covariation_status": "unavailable", + "stage2_posterior": 0.9983134438970862, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_001873345.1:c15:6656:7091-7187", + "covariation_status": "passed", + "stage2_posterior": 0.011880178781418182, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_001873345.1:c41:14848:15379-15483", + "covariation_status": "failed", + "stage2_posterior": 0.843357625125464, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_001873345.1:c41:14848:15501-15645", + "covariation_status": "unavailable", + "stage2_posterior": 0.0006075844882299791, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_001873345.1:c41:15360:15403-15483", + "covariation_status": "unavailable", + "stage2_posterior": 0.49004723834182157, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_001873345.1:c41:15360:15501-15581", + "covariation_status": "unavailable", + "stage2_posterior": 1.432105712634677e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_002391195.1:c82:10240:10696-10778", + "covariation_status": "unavailable", + "stage2_posterior": 6.749076495888358e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_002878375.1:c13:25088:25832-25986", + "covariation_status": "unavailable", + "stage2_posterior": 0.9991150800508758, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_002878375.1:c13:25088:26002-26072", + "covariation_status": "passed", + "stage2_posterior": 4.3190447588397665e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_002878375.1:c13:25600:25832-25986", + "covariation_status": "unavailable", + "stage2_posterior": 0.9991150800508758, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_002878375.1:c13:25600:26002-26072", + "covariation_status": "passed", + "stage2_posterior": 4.3190447588397665e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_002878375.1:c1:22528:23222-23375", + "covariation_status": "failed", + "stage2_posterior": 0.9980832441333141, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_002878375.1:c1:22528:23425-23502", + "covariation_status": "passed", + "stage2_posterior": 5.489685684712592e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_002878375.1:c1:23040:23222-23375", + "covariation_status": "failed", + "stage2_posterior": 0.9980832441333141, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_002878375.1:c1:23040:23425-23502", + "covariation_status": "passed", + "stage2_posterior": 5.489685684712592e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_002878375.1:c7:39936:40675-40840", + "covariation_status": "passed", + "stage2_posterior": 0.9985289872532181, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_002878375.1:c7:39936:40855-40936", + "covariation_status": "unavailable", + "stage2_posterior": 1.2732973659741077e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_002878375.1:c7:40448:40675-40840", + "covariation_status": "passed", + "stage2_posterior": 0.9985289872532181, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_002878375.1:c7:40448:40855-40936", + "covariation_status": "unavailable", + "stage2_posterior": 1.2732973659741077e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_003290465.1:c0:524800:525324-525429", + "covariation_status": "unavailable", + "stage2_posterior": 1.2062293302824059e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_003290465.1:c0:524800:525446-525597", + "covariation_status": "passed", + "stage2_posterior": 0.9937335385485407, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_003290465.1:c0:525312:525324-525429", + "covariation_status": "unavailable", + "stage2_posterior": 1.2062293302824059e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_003290465.1:c0:525312:525446-525597", + "covariation_status": "passed", + "stage2_posterior": 0.9937335385485407, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_003314535.1:c17:4608:5067-5144", + "covariation_status": "failed", + "stage2_posterior": 2.9262642493405787e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_003314535.1:c17:4608:5160-5301", + "covariation_status": "passed", + "stage2_posterior": 0.9978527357598724, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_003314535.1:c17:5120:5160-5299", + "covariation_status": "passed", + "stage2_posterior": 0.997955780125689, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_005116895.1:c0:296960:297464-297551", + "covariation_status": "passed", + "stage2_posterior": 2.0947817897968463e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_005116895.1:c0:296960:297582-297736", + "covariation_status": "failed", + "stage2_posterior": 0.9969474304423277, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_005116895.1:c0:297472:297472-297551", + "covariation_status": "failed", + "stage2_posterior": 1.9217017606459634e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_005116895.1:c0:297472:297582-297736", + "covariation_status": "failed", + "stage2_posterior": 0.9969474304423277, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c150:1536:2200-2347", + "covariation_status": "unavailable", + "stage2_posterior": 0.8989390158933124, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c150:1536:2370-2494", + "covariation_status": "passed", + "stage2_posterior": 0.9922862263956532, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c150:2048:2200-2347", + "covariation_status": "unavailable", + "stage2_posterior": 0.8989390158933124, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c150:2048:2370-2494", + "covariation_status": "passed", + "stage2_posterior": 0.9922862263956532, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c151:4096:4442-4512", + "covariation_status": "unavailable", + "stage2_posterior": 1.705814656857024e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c151:4096:4532-4624", + "covariation_status": "unavailable", + "stage2_posterior": 2.7194617185569183e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c181:7168:7792-7907", + "covariation_status": "unavailable", + "stage2_posterior": 1.1893888576547399e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c181:7168:7924-8012", + "covariation_status": "unavailable", + "stage2_posterior": 0.10944754311502737, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c181:7680:7792-7907", + "covariation_status": "unavailable", + "stage2_posterior": 1.1893888576547399e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c181:7680:7924-8012", + "covariation_status": "unavailable", + "stage2_posterior": 0.10944754311502737, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c183:6144:6428-6519", + "covariation_status": "failed", + "stage2_posterior": 1.9406588810226617e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c183:6144:6540-6679", + "covariation_status": "unavailable", + "stage2_posterior": 0.9231220988124119, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c225:4608:5174-5333", + "covariation_status": "unavailable", + "stage2_posterior": 0.9935403988044491, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c225:4608:5379-5475", + "covariation_status": "failed", + "stage2_posterior": 4.447485969367135e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c225:5120:5174-5333", + "covariation_status": "unavailable", + "stage2_posterior": 0.9935403988044491, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c225:5120:5384-5475", + "covariation_status": "failed", + "stage2_posterior": 0.0007388284950304073, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c228:8704:9216-9328", + "covariation_status": "unavailable", + "stage2_posterior": 0.00011770953172040884, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c228:8704:9345-9438", + "covariation_status": "failed", + "stage2_posterior": 0.0002474818414832701, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c228:9216:9346-9400", + "covariation_status": "unavailable", + "stage2_posterior": 0.0007184116554292655, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_011056645.1:c34:13312:13824-13931", + "covariation_status": "failed", + "stage2_posterior": 0.2264065438840245, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c34:13312:13947-14099", + "covariation_status": "unavailable", + "stage2_posterior": 0.000858461299874876, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c34:13822:13852-13931", + "covariation_status": "unavailable", + "stage2_posterior": 7.590513153669362e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c34:13822:14005-14098", + "covariation_status": "unavailable", + "stage2_posterior": 5.3011160358324585e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c34:9216:10045-10168", + "covariation_status": "unavailable", + "stage2_posterior": 2.6029587073293754e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c34:9216:9928-10027", + "covariation_status": "failed", + "stage2_posterior": 0.13929348920170498, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c34:9728:10045-10168", + "covariation_status": "unavailable", + "stage2_posterior": 2.6029587073293754e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c34:9728:9928-10027", + "covariation_status": "failed", + "stage2_posterior": 0.13929348920170498, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c71:2560:3260-3392", + "covariation_status": "unavailable", + "stage2_posterior": 6.333603310226922e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c71:2560:3442-3526", + "covariation_status": "unavailable", + "stage2_posterior": 2.9566457693710187e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c71:3072:3260-3392", + "covariation_status": "unavailable", + "stage2_posterior": 6.333603310226922e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c71:3072:3442-3526", + "covariation_status": "unavailable", + "stage2_posterior": 2.9566457693710187e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c84:2560:3261-3352", + "covariation_status": "failed", + "stage2_posterior": 0.20865620979271857, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c84:2560:3402-3469", + "covariation_status": "failed", + "stage2_posterior": 3.21933810852117e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c84:3072:3261-3335", + "covariation_status": "failed", + "stage2_posterior": 0.08865587225138848, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_011056645.1:c84:3072:3466-3610", + "covariation_status": "unavailable", + "stage2_posterior": 0.029892649371396175, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_012517635.1:c118:2560:3053-3129", + "covariation_status": "passed", + "stage2_posterior": 5.698505569121462e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c118:2560:3146-3292", + "covariation_status": "unavailable", + "stage2_posterior": 4.900738994743685e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c118:3072:3146-3285", + "covariation_status": "unavailable", + "stage2_posterior": 2.10815774205771e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c150:9216:9661-9803", + "covariation_status": "unavailable", + "stage2_posterior": 0.995791087288344, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_012517635.1:c150:9216:9848-9927", + "covariation_status": "passed", + "stage2_posterior": 1.986131210445497e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_012517635.1:c192:1024:1207-1280", + "covariation_status": "passed", + "stage2_posterior": 0.00011174056519967742, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c192:1024:1292-1421", + "covariation_status": "passed", + "stage2_posterior": 0.8504770409109098, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c192:512:1207-1280", + "covariation_status": "passed", + "stage2_posterior": 0.00011174056519967742, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c192:512:1292-1421", + "covariation_status": "passed", + "stage2_posterior": 0.8504770409109098, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c230:11264:11739-11868", + "covariation_status": "passed", + "stage2_posterior": 0.9939151644316639, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c230:11264:11881-11953", + "covariation_status": "passed", + "stage2_posterior": 3.2987259807336683e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c230:11511:11739-11868", + "covariation_status": "passed", + "stage2_posterior": 0.9939151644316639, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c230:11511:11881-11953", + "covariation_status": "passed", + "stage2_posterior": 3.2987259807336683e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c308:0:205-287", + "covariation_status": "unavailable", + "stage2_posterior": 3.1373248820398705e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c308:0:306-454", + "covariation_status": "unavailable", + "stage2_posterior": 8.027851783745902e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c397:11264:11929-12066", + "covariation_status": "unavailable", + "stage2_posterior": 8.450871592466849e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c397:11264:12108-12188", + "covariation_status": "passed", + "stage2_posterior": 0.00042599272834977826, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c397:11776:11929-12066", + "covariation_status": "unavailable", + "stage2_posterior": 8.450871592466849e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c397:11776:12108-12188", + "covariation_status": "passed", + "stage2_posterior": 0.00042599272834977826, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_012517635.1:c441:0:228-305", + "covariation_status": "passed", + "stage2_posterior": 0.0010476801200126938, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_012517635.1:c441:0:39-183", + "covariation_status": "unavailable", + "stage2_posterior": 0.9980908722534803, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_015478585.1:c26:4608:4903-5024", + "covariation_status": "passed", + "stage2_posterior": 0.0009703351058186599, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_015478585.1:c26:4608:5040-5154", + "covariation_status": "failed", + "stage2_posterior": 5.169137786808996e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_015478585.1:c74:17408:18233-18319", + "covariation_status": "unavailable", + "stage2_posterior": 1.3463382345813328e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_015478585.1:c74:17593:18228-18319", + "covariation_status": "unavailable", + "stage2_posterior": 1.3434967114066567e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_017458885.1:c106:0:358-447", + "covariation_status": "unavailable", + "stage2_posterior": 6.5749115232340495e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_017458885.1:c106:0:530-670", + "covariation_status": "unavailable", + "stage2_posterior": 0.9982724659656127, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_017458885.1:c106:512:582-663", + "covariation_status": "unavailable", + "stage2_posterior": 0.0006135515293427295, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_017458885.1:c117:1024:1281-1429", + "covariation_status": "unavailable", + "stage2_posterior": 0.7123814956010261, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_017458885.1:c117:1024:1462-1540", + "covariation_status": "unavailable", + "stage2_posterior": 9.99259505613185e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_017458885.1:c117:512:1281-1429", + "covariation_status": "unavailable", + "stage2_posterior": 0.7123814956010261, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_017458885.1:c44:3072:3406-3498", + "covariation_status": "unavailable", + "stage2_posterior": 1.248986292779772e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_017458885.1:c44:3072:3525-3665", + "covariation_status": "unavailable", + "stage2_posterior": 0.9823767888104719, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c102:4608:5151-5228", + "covariation_status": "unavailable", + "stage2_posterior": 2.9265554053278017e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c102:4608:5249-5369", + "covariation_status": "unavailable", + "stage2_posterior": 1.59341364617264e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c102:5120:5151-5228", + "covariation_status": "unavailable", + "stage2_posterior": 2.9265554053278017e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c102:5120:5249-5369", + "covariation_status": "unavailable", + "stage2_posterior": 1.59341364617264e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c19:4096:4875-5016", + "covariation_status": "unavailable", + "stage2_posterior": 4.092794175123105e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c19:4096:5032-5089", + "covariation_status": "unavailable", + "stage2_posterior": 7.069155211496247e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c19:4608:4875-5016", + "covariation_status": "unavailable", + "stage2_posterior": 4.092794175123105e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c19:4608:5032-5115", + "covariation_status": "unavailable", + "stage2_posterior": 1.159845472728438e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c21:0:139-269", + "covariation_status": "passed", + "stage2_posterior": 0.9974434430697073, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c21:0:284-400", + "covariation_status": "unavailable", + "stage2_posterior": 1.709338155087609e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c27:12199:12620-12693", + "covariation_status": "unavailable", + "stage2_posterior": 1.0718965576065123e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_018714045.1:c27:12199:12709-12841", + "covariation_status": "unavailable", + "stage2_posterior": 2.7637688192370685e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_019038705.1:c206:7168:7907-8090", + "covariation_status": "unavailable", + "stage2_posterior": 1.325426726762147e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_019038705.1:c206:7168:8110-8192", + "covariation_status": "unavailable", + "stage2_posterior": 6.313708685167443e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_019038705.1:c206:7680:7907-8090", + "covariation_status": "unavailable", + "stage2_posterior": 1.3213659769193396e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_019038705.1:c206:7680:8110-8252", + "covariation_status": "unavailable", + "stage2_posterior": 7.535881948915905e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_019636815.1:c6:79872:80662-80816", + "covariation_status": "failed", + "stage2_posterior": 0.9822503694476163, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_019636815.1:c6:80384:80662-80816", + "covariation_status": "failed", + "stage2_posterior": 0.9822503694476163, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_019636815.1:c6:80384:80833-80936", + "covariation_status": "passed", + "stage2_posterior": 0.0001903039816269353, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_020434495.1:c711:0:158-286", + "covariation_status": "failed", + "stage2_posterior": 3.882226191698322e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_020434495.1:c711:0:304-481", + "covariation_status": "passed", + "stage2_posterior": 0.00016460324923157153, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_023145315.1:c134:2560:2962-3039", + "covariation_status": "unavailable", + "stage2_posterior": 7.673367586528003e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c0:84480:85162-85275", + "covariation_status": "unavailable", + "stage2_posterior": 0.9797769452819095, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c0:84992:85162-85275", + "covariation_status": "unavailable", + "stage2_posterior": 0.9797769452819095, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c13:22528:23157-23220", + "covariation_status": "failed", + "stage2_posterior": 0.04683373950073355, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c13:22528:23234-23355", + "covariation_status": "unavailable", + "stage2_posterior": 0.9549001031449394, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c13:23040:23157-23220", + "covariation_status": "failed", + "stage2_posterior": 0.04683373950073355, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c13:23040:23233-23355", + "covariation_status": "unavailable", + "stage2_posterior": 0.9857231184388204, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c1:116736:117389-117460", + "covariation_status": "failed", + "stage2_posterior": 0.07149356081375949, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c1:116736:117475-117603", + "covariation_status": "unavailable", + "stage2_posterior": 0.9943765027929348, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c1:117248:117389-117460", + "covariation_status": "failed", + "stage2_posterior": 0.07149356081375949, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c1:117248:117475-117603", + "covariation_status": "unavailable", + "stage2_posterior": 0.9943765027929348, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c1:206848:207711-207804", + "covariation_status": "unavailable", + "stage2_posterior": 0.0004993989610605448, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c1:207360:207711-207804", + "covariation_status": "unavailable", + "stage2_posterior": 0.0004993989610605448, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c1:90624:91429-91539", + "covariation_status": "unavailable", + "stage2_posterior": 4.906790326338765e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_023663235.1:c1:91136:91429-91538", + "covariation_status": "unavailable", + "stage2_posterior": 5.3949513813079074e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_023663235.1:c2:128000:128588-128717", + "covariation_status": "unavailable", + "stage2_posterior": 0.9987480369925531, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c2:128512:128588-128717", + "covariation_status": "unavailable", + "stage2_posterior": 0.9987480369925531, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c2:70144:70657-70849", + "covariation_status": "unavailable", + "stage2_posterior": 0.99917487162686, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c2:70656:70657-70713", + "covariation_status": "unavailable", + "stage2_posterior": 3.832843425131419e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c2:70656:70726-70843", + "covariation_status": "unavailable", + "stage2_posterior": 0.03657441556804956, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c3:8192:8836-8899", + "covariation_status": "failed", + "stage2_posterior": 0.04324933326286089, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c3:8192:8914-9024", + "covariation_status": "unavailable", + "stage2_posterior": 0.0005034501114772379, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c3:86016:86548-86624", + "covariation_status": "unavailable", + "stage2_posterior": 0.00033886908210260786, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c3:8704:8836-8899", + "covariation_status": "failed", + "stage2_posterior": 0.04324933326286089, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c3:8704:8914-9024", + "covariation_status": "unavailable", + "stage2_posterior": 0.0005034501114772379, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c4:27136:27697-27764", + "covariation_status": "unavailable", + "stage2_posterior": 0.015540257633813186, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c4:27136:27779-27914", + "covariation_status": "unavailable", + "stage2_posterior": 1.2027127431406033e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c4:27648:27697-27764", + "covariation_status": "unavailable", + "stage2_posterior": 0.015540257633813186, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c4:27648:27779-27911", + "covariation_status": "unavailable", + "stage2_posterior": 1.4513109023037983e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_023663235.1:c7:26112:26677-26802", + "covariation_status": "unavailable", + "stage2_posterior": 0.00011844622314435581, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c7:26112:26818-26885", + "covariation_status": "failed", + "stage2_posterior": 0.00016750102612081902, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c7:26624:26677-26802", + "covariation_status": "unavailable", + "stage2_posterior": 0.00011844622314435581, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_023663235.1:c7:26624:26818-26885", + "covariation_status": "failed", + "stage2_posterior": 0.00016750102612081902, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_024642575.1:c138:9216:9641-9821", + "covariation_status": "unavailable", + "stage2_posterior": 0.9897338785327502, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_024642575.1:c138:9216:9860-9940", + "covariation_status": "unavailable", + "stage2_posterior": 1.0840946007012949e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_024642575.1:c95:12288:12939-13026", + "covariation_status": "unavailable", + "stage2_posterior": 6.120117918261828e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_024642575.1:c95:12288:13048-13145", + "covariation_status": "unavailable", + "stage2_posterior": 6.475900970307341e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_024642575.1:c95:12800:12940-13026", + "covariation_status": "unavailable", + "stage2_posterior": 6.00255804067351e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_024642575.1:c95:12800:13044-13145", + "covariation_status": "unavailable", + "stage2_posterior": 1.351508130078634e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_025060475.1:c0:194048:194397-194550", + "covariation_status": "passed", + "stage2_posterior": 0.9973427211367044, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c0:194048:194581-194682", + "covariation_status": "passed", + "stage2_posterior": 0.0001261410900462209, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c1:16384:16728-16835", + "covariation_status": "unavailable", + "stage2_posterior": 8.869560425226166e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c1:16384:16850-17016", + "covariation_status": "passed", + "stage2_posterior": 0.9992913934468874, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c1:41984:42685-42838", + "covariation_status": "failed", + "stage2_posterior": 0.9978175070954063, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c1:41984:42887-42976", + "covariation_status": "passed", + "stage2_posterior": 0.000635703782945328, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c1:42496:42685-42838", + "covariation_status": "failed", + "stage2_posterior": 0.9978175070954063, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c1:42496:42869-42976", + "covariation_status": "passed", + "stage2_posterior": 8.011181517746709e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c2:38912:39333-39480", + "covariation_status": "unavailable", + "stage2_posterior": 0.9993475146147314, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_025060475.1:c2:38912:39495-39593", + "covariation_status": "failed", + "stage2_posterior": 1.095196422346235e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_027450145.1:c31:18432:18779-18881", + "covariation_status": "unavailable", + "stage2_posterior": 9.516982251577955e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_027450145.1:c31:18432:18930-19075", + "covariation_status": "unavailable", + "stage2_posterior": 0.9965074604641607, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_027450145.1:c3:68608:69077-69165", + "covariation_status": "unavailable", + "stage2_posterior": 4.860631749511369e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_027450145.1:c3:68608:69183-69332", + "covariation_status": "unavailable", + "stage2_posterior": 0.9926871450815705, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_027450145.1:c3:69120:69183-69332", + "covariation_status": "unavailable", + "stage2_posterior": 0.9926871450815705, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_027450145.1:c69:14336:15013-15121", + "covariation_status": "passed", + "stage2_posterior": 0.00023346375119340676, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_027450145.1:c69:14336:15138-15280", + "covariation_status": "unavailable", + "stage2_posterior": 0.9977175628279211, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_027450145.1:c69:14848:15013-15121", + "covariation_status": "passed", + "stage2_posterior": 0.00023346375119340676, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_027450145.1:c69:14848:15138-15280", + "covariation_status": "unavailable", + "stage2_posterior": 0.9977175628279211, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c24:0:612-752", + "covariation_status": "passed", + "stage2_posterior": 0.9982178368117228, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c24:0:767-852", + "covariation_status": "unavailable", + "stage2_posterior": 7.775974513192585e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c24:512:612-752", + "covariation_status": "passed", + "stage2_posterior": 0.9982178368117228, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c24:512:767-852", + "covariation_status": "unavailable", + "stage2_posterior": 7.775974513192585e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c27:2048:2724-2808", + "covariation_status": "failed", + "stage2_posterior": 0.688587600227556, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c27:2048:2824-2979", + "covariation_status": "unavailable", + "stage2_posterior": 0.9980333620873393, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c27:2560:2724-2808", + "covariation_status": "failed", + "stage2_posterior": 0.688587600227556, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c27:2560:2824-2979", + "covariation_status": "unavailable", + "stage2_posterior": 0.9980333620873393, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c3:1024:1201-1357", + "covariation_status": "passed", + "stage2_posterior": 0.9981225860479555, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c3:1024:1412-1487", + "covariation_status": "passed", + "stage2_posterior": 3.92037187421924e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c3:512:1201-1357", + "covariation_status": "passed", + "stage2_posterior": 0.9981225860479555, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c3:512:1413-1487", + "covariation_status": "passed", + "stage2_posterior": 3.471990074764447e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c7:6144:6744-6893", + "covariation_status": "unavailable", + "stage2_posterior": 0.999368834746326, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c7:6144:6909-6978", + "covariation_status": "passed", + "stage2_posterior": 8.017017236860795e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c7:6656:6744-6893", + "covariation_status": "unavailable", + "stage2_posterior": 0.999368834746326, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_028276205.1:c7:6656:6909-6978", + "covariation_status": "passed", + "stage2_posterior": 8.017017236860795e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030673965.1:c1:399872:400517-400656", + "covariation_status": "unavailable", + "stage2_posterior": 0.9934432893452638, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_030673965.1:c1:400384:400517-400656", + "covariation_status": "unavailable", + "stage2_posterior": 0.9934432893452638, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_030765645.1:c55:21504:21980-22124", + "covariation_status": "passed", + "stage2_posterior": 0.9989749904098554, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_030765645.1:c55:21504:22145-22237", + "covariation_status": "passed", + "stage2_posterior": 1.5139043356632971e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_030765645.1:c55:22016:22016-22124", + "covariation_status": "failed", + "stage2_posterior": 4.916990829931683e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_030765645.1:c55:22016:22145-22237", + "covariation_status": "passed", + "stage2_posterior": 1.5139043356632971e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_030834825.1:c38:10180:10677-10787", + "covariation_status": "failed", + "stage2_posterior": 2.0193549377201877e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c38:10180:10804-10992", + "covariation_status": "unavailable", + "stage2_posterior": 0.9924642597377871, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c40:2560:3282-3484", + "covariation_status": "unavailable", + "stage2_posterior": 0.00010632026261331643, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c40:2560:3502-3579", + "covariation_status": "passed", + "stage2_posterior": 2.771511289889392e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c40:3072:3279-3484", + "covariation_status": "unavailable", + "stage2_posterior": 6.56043891343969e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c40:3072:3502-3579", + "covariation_status": "passed", + "stage2_posterior": 2.771511289889392e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c460:14848:15219-15292", + "covariation_status": "unavailable", + "stage2_posterior": 1.3829204787784885e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c460:14848:15310-15420", + "covariation_status": "unavailable", + "stage2_posterior": 2.4009182486189327e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c791:6656:6945-7141", + "covariation_status": "unavailable", + "stage2_posterior": 0.27063318682246584, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c791:6656:7176-7255", + "covariation_status": "passed", + "stage2_posterior": 0.00018627473623597423, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c861:11264:11722-11802", + "covariation_status": "passed", + "stage2_posterior": 1.1045827588809328e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_030834825.1:c861:11264:11840-11983", + "covariation_status": "unavailable", + "stage2_posterior": 6.863134635096676e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_031266695.1:c173:6144:6792-6846", + "covariation_status": "unavailable", + "stage2_posterior": 6.331856960150994e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031266695.1:c173:6144:6862-7063", + "covariation_status": "unavailable", + "stage2_posterior": 0.998850769356434, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031266695.1:c173:6287:6792-6846", + "covariation_status": "unavailable", + "stage2_posterior": 6.331856960150994e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031266695.1:c173:6287:6862-7063", + "covariation_status": "unavailable", + "stage2_posterior": 0.998850769356434, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031268125.1:c279:1024:1151-1317", + "covariation_status": "unavailable", + "stage2_posterior": 0.9586061731330571, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031268125.1:c279:1024:1338-1425", + "covariation_status": "unavailable", + "stage2_posterior": 4.361051826269194e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031268125.1:c279:512:1151-1317", + "covariation_status": "unavailable", + "stage2_posterior": 0.9586061731330571, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031268125.1:c279:512:1338-1401", + "covariation_status": "unavailable", + "stage2_posterior": 5.762286116207591e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031275485.1:c16:7680:7999-8091", + "covariation_status": "unavailable", + "stage2_posterior": 4.6018834542588815e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031275485.1:c16:7680:8106-8169", + "covariation_status": "unavailable", + "stage2_posterior": 6.872184002854988e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031275485.1:c62:38912:39281-39342", + "covariation_status": "unavailable", + "stage2_posterior": 6.352218623355867e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031275485.1:c62:38912:39475-39526", + "covariation_status": "unavailable", + "stage2_posterior": 1.7294854571212636e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c0:292864:293279-293435", + "covariation_status": "unavailable", + "stage2_posterior": 0.8101331034524043, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c0:320512:321063-321291", + "covariation_status": "unavailable", + "stage2_posterior": 0.9906787503448922, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c0:320512:321311-321432", + "covariation_status": "unavailable", + "stage2_posterior": 0.00013547507119792375, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c0:321024:321063-321291", + "covariation_status": "unavailable", + "stage2_posterior": 0.9906787503448922, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c0:321024:321311-321436", + "covariation_status": "unavailable", + "stage2_posterior": 0.0008393592402167081, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c12:26112:26834-26892", + "covariation_status": "unavailable", + "stage2_posterior": 1.8553698170298223e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c12:26624:26816-26892", + "covariation_status": "passed", + "stage2_posterior": 4.1837917943900815e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c12:26624:26987-27146", + "covariation_status": "failed", + "stage2_posterior": 0.9979495098836898, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c13:39936:40783-40842", + "covariation_status": "unavailable", + "stage2_posterior": 1.514610789345312e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c13:40448:40758-40873", + "covariation_status": "failed", + "stage2_posterior": 7.736044477417271e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c13:40448:40890-41056", + "covariation_status": "unavailable", + "stage2_posterior": 0.2274572264452178, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c14:39936:40433-40558", + "covariation_status": "unavailable", + "stage2_posterior": 7.800293289268214e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c14:39936:40574-40722", + "covariation_status": "unavailable", + "stage2_posterior": 0.9984700628367441, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c14:40448:40451-40558", + "covariation_status": "unavailable", + "stage2_posterior": 5.7839925378319155e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c14:40448:40574-40722", + "covariation_status": "unavailable", + "stage2_posterior": 0.9984700628367441, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c16:39424:40088-40180", + "covariation_status": "unavailable", + "stage2_posterior": 0.34007594662546964, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c16:39936:40082-40319", + "covariation_status": "unavailable", + "stage2_posterior": 0.9974740300981185, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c16:39936:40402-40486", + "covariation_status": "passed", + "stage2_posterior": 7.486496688550479e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c1:25088:25707-25834", + "covariation_status": "unavailable", + "stage2_posterior": 1.2465513668512199e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c1:25088:25883-26032", + "covariation_status": "unavailable", + "stage2_posterior": 6.046865131460811e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c1:25600:25718-25834", + "covariation_status": "unavailable", + "stage2_posterior": 2.358254220487647e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c1:25600:25883-26040", + "covariation_status": "unavailable", + "stage2_posterior": 6.6876867996600805e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c1:27648:28233-28406", + "covariation_status": "unavailable", + "stage2_posterior": 1.4397195452727944e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c1:27648:28424-28579", + "covariation_status": "unavailable", + "stage2_posterior": 6.525528137101032e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c1:28160:28289-28403", + "covariation_status": "unavailable", + "stage2_posterior": 6.29872931109414e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c1:28160:28424-28524", + "covariation_status": "unavailable", + "stage2_posterior": 5.641836320369192e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c25:18432:18961-19134", + "covariation_status": "unavailable", + "stage2_posterior": 0.014816864310096236, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c25:18432:19155-19292", + "covariation_status": "unavailable", + "stage2_posterior": 0.9996726222749988, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c25:18944:18981-19134", + "covariation_status": "unavailable", + "stage2_posterior": 0.008188541651378773, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c25:18944:19155-19292", + "covariation_status": "unavailable", + "stage2_posterior": 0.9996726222749988, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c40:12800:13477-13545", + "covariation_status": "unavailable", + "stage2_posterior": 4.639659736872203e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c40:12800:13562-13722", + "covariation_status": "unavailable", + "stage2_posterior": 0.9788176644562395, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c40:13312:13453-13545", + "covariation_status": "passed", + "stage2_posterior": 2.8106488945534517e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c40:13312:13562-13722", + "covariation_status": "unavailable", + "stage2_posterior": 0.9788176644562395, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c45:1536:2447-2537", + "covariation_status": "unavailable", + "stage2_posterior": 0.0002668701301831631, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c45:2048:2442-2594", + "covariation_status": "unavailable", + "stage2_posterior": 0.9982137447414691, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c45:2048:2611-2710", + "covariation_status": "unavailable", + "stage2_posterior": 1.0847991005313543e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c5:29184:29671-29755", + "covariation_status": "unavailable", + "stage2_posterior": 5.169997911464705e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c5:29184:29771-29980", + "covariation_status": "unavailable", + "stage2_posterior": 0.9980019438660871, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c5:29696:29771-29829", + "covariation_status": "unavailable", + "stage2_posterior": 5.007818814356478e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c5:98304:99022-99105", + "covariation_status": "unavailable", + "stage2_posterior": 2.4925883813047693e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c5:98304:99164-99314", + "covariation_status": "unavailable", + "stage2_posterior": 0.10567893147242778, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c5:98760:99022-99105", + "covariation_status": "unavailable", + "stage2_posterior": 2.4925883813047693e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c5:98760:99164-99314", + "covariation_status": "unavailable", + "stage2_posterior": 0.10567893147242778, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031458695.1:c9:67072:67610-67719", + "covariation_status": "unavailable", + "stage2_posterior": 6.0543522451178505e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_031458695.1:c9:67072:67736-67885", + "covariation_status": "passed", + "stage2_posterior": 0.999023366377241, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_031458695.1:c9:67584:67610-67719", + "covariation_status": "unavailable", + "stage2_posterior": 6.0543522451178505e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_031458695.1:c9:67584:67736-67885", + "covariation_status": "passed", + "stage2_posterior": 0.999023366377241, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_031459235.1:c10:7168:7599-7738", + "covariation_status": "passed", + "stage2_posterior": 7.924447187160703e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c10:7168:7755-7877", + "covariation_status": "failed", + "stage2_posterior": 3.260037044982093e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c14:13824:14324-14500", + "covariation_status": "unavailable", + "stage2_posterior": 1.2782637372900714e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c14:13824:14516-14631", + "covariation_status": "unavailable", + "stage2_posterior": 9.344144710302496e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c14:14336:14370-14500", + "covariation_status": "unavailable", + "stage2_posterior": 5.720006814731129e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c14:14336:14517-14631", + "covariation_status": "unavailable", + "stage2_posterior": 8.800835508576821e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c19:31744:32008-32174", + "covariation_status": "unavailable", + "stage2_posterior": 1.0979074370405153e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c19:31744:32190-32351", + "covariation_status": "unavailable", + "stage2_posterior": 9.246509529463255e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c24:23040:23853-23986", + "covariation_status": "unavailable", + "stage2_posterior": 0.00034427874087833345, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c24:23040:24001-24060", + "covariation_status": "unavailable", + "stage2_posterior": 5.209296250089231e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c24:23552:23848-23986", + "covariation_status": "unavailable", + "stage2_posterior": 0.0013672834703200897, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c24:23552:24001-24091", + "covariation_status": "passed", + "stage2_posterior": 1.0115507093733817e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c2:57856:58598-58673", + "covariation_status": "unavailable", + "stage2_posterior": 6.832475246939838e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c2:57856:58689-58820", + "covariation_status": "unavailable", + "stage2_posterior": 0.0005495725551319764, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c2:58368:58598-58673", + "covariation_status": "unavailable", + "stage2_posterior": 6.832475246939838e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c2:58368:58689-58820", + "covariation_status": "unavailable", + "stage2_posterior": 0.0005495725551319764, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c3:58880:59407-59550", + "covariation_status": "unavailable", + "stage2_posterior": 1.1318986679800066e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c3:58880:59567-59687", + "covariation_status": "unavailable", + "stage2_posterior": 7.834018193462194e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c56:3584:3980-4118", + "covariation_status": "failed", + "stage2_posterior": 0.016308575273052052, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c56:3584:4133-4209", + "covariation_status": "unavailable", + "stage2_posterior": 5.5483438237819056e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c6:48640:49147-49269", + "covariation_status": "passed", + "stage2_posterior": 1.2542436881636944e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c6:48640:49322-49460", + "covariation_status": "unavailable", + "stage2_posterior": 0.0021582847916522103, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c74:2560:3305-3396", + "covariation_status": "passed", + "stage2_posterior": 7.020755464608656e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c74:2560:3413-3524", + "covariation_status": "unavailable", + "stage2_posterior": 5.570515675362691e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c74:3072:3305-3396", + "covariation_status": "passed", + "stage2_posterior": 7.020755464608656e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c74:3072:3413-3526", + "covariation_status": "unavailable", + "stage2_posterior": 5.980406382416205e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c74:5120:5547-5636", + "covariation_status": "passed", + "stage2_posterior": 1.1504828901272575e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c74:5120:5653-5834", + "covariation_status": "unavailable", + "stage2_posterior": 7.879923163480872e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c82:6144:6758-6848", + "covariation_status": "passed", + "stage2_posterior": 7.463510029432117e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c82:6144:6865-7017", + "covariation_status": "unavailable", + "stage2_posterior": 1.9823818789438834e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c82:6656:6758-6848", + "covariation_status": "passed", + "stage2_posterior": 7.470090064202492e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c82:6656:6865-7017", + "covariation_status": "unavailable", + "stage2_posterior": 1.9823818789438834e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459235.1:c86:6144:6438-6592", + "covariation_status": "unavailable", + "stage2_posterior": 0.04251428740676404, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_031459855.1:c0:1113088:1113361-1113551", + "covariation_status": "unavailable", + "stage2_posterior": 5.856865897950521e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:1113088:1113568-1113678", + "covariation_status": "passed", + "stage2_posterior": 9.084673612135108e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:1156096:1156615-1156770", + "covariation_status": "unavailable", + "stage2_posterior": 0.9936217036464319, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_031459855.1:c0:1156096:1156793-1156915", + "covariation_status": "unavailable", + "stage2_posterior": 7.18224844178223e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_031459855.1:c0:1156608:1156671-1156769", + "covariation_status": "unavailable", + "stage2_posterior": 5.048652706528666e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_031459855.1:c0:1156608:1156793-1156915", + "covariation_status": "unavailable", + "stage2_posterior": 7.18224844178223e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2435584:2435926-2436092", + "covariation_status": "unavailable", + "stage2_posterior": 1.896310060064867e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2435584:2436109-2436208", + "covariation_status": "unavailable", + "stage2_posterior": 4.3378398467490974e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:245248:245717-245801", + "covariation_status": "unavailable", + "stage2_posterior": 1.1384807773785598e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:245248:245816-245970", + "covariation_status": "unavailable", + "stage2_posterior": 2.0985085831183445e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2465792:2466316-2466469", + "covariation_status": "unavailable", + "stage2_posterior": 0.46424761626154437, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2465792:2466487-2466563", + "covariation_status": "unavailable", + "stage2_posterior": 1.2684489156431497e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2466304:2466316-2466469", + "covariation_status": "unavailable", + "stage2_posterior": 0.46424761626154437, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2466304:2466487-2466563", + "covariation_status": "unavailable", + "stage2_posterior": 1.2684489156431497e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2530816:2531481-2531623", + "covariation_status": "passed", + "stage2_posterior": 4.977531696231196e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2530816:2531640-2531804", + "covariation_status": "unavailable", + "stage2_posterior": 0.0007834234441149147, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2531328:2531481-2531623", + "covariation_status": "passed", + "stage2_posterior": 4.977531696231196e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2531328:2531640-2531804", + "covariation_status": "unavailable", + "stage2_posterior": 0.0007834234441149147, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2629120:2629876-2630019", + "covariation_status": "passed", + "stage2_posterior": 0.04443535055871909, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2629120:2630044-2630137", + "covariation_status": "passed", + "stage2_posterior": 8.466876369665076e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2629632:2629876-2630018", + "covariation_status": "passed", + "stage2_posterior": 0.05287846734302923, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2629632:2630034-2630154", + "covariation_status": "passed", + "stage2_posterior": 9.587783456806405e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2700288:2700752-2700920", + "covariation_status": "unavailable", + "stage2_posterior": 0.0022001627574452834, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2700288:2700934-2701080", + "covariation_status": "unavailable", + "stage2_posterior": 0.02382451053408264, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2700800:2700803-2700920", + "covariation_status": "unavailable", + "stage2_posterior": 7.865231738757963e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2700800:2700934-2701076", + "covariation_status": "unavailable", + "stage2_posterior": 0.0009741275555215244, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2986496:2986889-2987002", + "covariation_status": "unavailable", + "stage2_posterior": 5.473031772633129e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2986496:2987017-2987187", + "covariation_status": "unavailable", + "stage2_posterior": 6.552446947812323e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:2987008:2987017-2987187", + "covariation_status": "unavailable", + "stage2_posterior": 6.552446947812323e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:524800:524997-525058", + "covariation_status": "unavailable", + "stage2_posterior": 4.731959163800414e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_031459855.1:c0:524800:525094-525235", + "covariation_status": "unavailable", + "stage2_posterior": 3.649457068681161e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_031459855.1:c0:892416:893161-893304", + "covariation_status": "unavailable", + "stage2_posterior": 0.00019499573206033824, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:892416:893319-893418", + "covariation_status": "passed", + "stage2_posterior": 4.862815858637801e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:892928:893161-893304", + "covariation_status": "unavailable", + "stage2_posterior": 0.00019499573206033824, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_031459855.1:c0:892928:893319-893411", + "covariation_status": "unavailable", + "stage2_posterior": 4.957104834835442e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035252115.1:c147:10240:10600-10695", + "covariation_status": "passed", + "stage2_posterior": 7.919380262868975e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035252115.1:c147:10240:10715-10850", + "covariation_status": "passed", + "stage2_posterior": 0.9335700345772517, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035252115.1:c147:10752:10758-10850", + "covariation_status": "failed", + "stage2_posterior": 8.811710403896825e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035295045.1:c172:23478:23927-24038", + "covariation_status": "unavailable", + "stage2_posterior": 5.0066926385259546e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035295045.1:c172:23478:24054-24173", + "covariation_status": "failed", + "stage2_posterior": 0.00511825054940481, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035295045.1:c390:11264:11916-12075", + "covariation_status": "unavailable", + "stage2_posterior": 0.997281629799138, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035295045.1:c390:11264:12124-12259", + "covariation_status": "unavailable", + "stage2_posterior": 1.0144557792712858e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035295045.1:c390:11776:11916-12075", + "covariation_status": "unavailable", + "stage2_posterior": 0.997281629799138, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035295045.1:c390:11776:12124-12259", + "covariation_status": "unavailable", + "stage2_posterior": 1.0144557792712858e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c13:35328:35812-35898", + "covariation_status": "passed", + "stage2_posterior": 6.552030624070303e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c13:35328:35913-36050", + "covariation_status": "passed", + "stage2_posterior": 0.9976310209443559, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c13:35840:35913-36048", + "covariation_status": "passed", + "stage2_posterior": 0.9978992340538159, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c1:89088:89859-89941", + "covariation_status": "passed", + "stage2_posterior": 0.00021233145421526526, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c1:89088:90054-90112", + "covariation_status": "unavailable", + "stage2_posterior": 8.502232040018746e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c1:89600:89859-89941", + "covariation_status": "passed", + "stage2_posterior": 0.00021233145421526526, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c1:89600:89997-90150", + "covariation_status": "unavailable", + "stage2_posterior": 0.9980819392810067, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c2:28160:28885-29038", + "covariation_status": "unavailable", + "stage2_posterior": 0.9996182290425545, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c2:28160:29054-29123", + "covariation_status": "failed", + "stage2_posterior": 0.00019564474816757875, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c2:28672:28885-29038", + "covariation_status": "unavailable", + "stage2_posterior": 0.9996182290425545, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035378845.1:c2:28672:29054-29123", + "covariation_status": "failed", + "stage2_posterior": 0.00019564474816757875, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c116:21504:21817-21960", + "covariation_status": "unavailable", + "stage2_posterior": 6.974587862625266e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c116:21504:21979-22056", + "covariation_status": "unavailable", + "stage2_posterior": 1.273028054270423e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c123:10752:11401-11537", + "covariation_status": "unavailable", + "stage2_posterior": 0.0003049690063752183, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_035477455.1:c123:10752:11550-11618", + "covariation_status": "passed", + "stage2_posterior": 6.250348693812691e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_035477455.1:c123:11264:11401-11537", + "covariation_status": "unavailable", + "stage2_posterior": 0.0003049690063752183, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_035477455.1:c123:11264:11551-11618", + "covariation_status": "passed", + "stage2_posterior": 9.607648848449411e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_035477455.1:c158:12288:12982-13126", + "covariation_status": "unavailable", + "stage2_posterior": 1.1327639767489235e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c158:12288:13172-13252", + "covariation_status": "passed", + "stage2_posterior": 0.00014600882978173043, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c158:12800:12982-13126", + "covariation_status": "unavailable", + "stage2_posterior": 1.1327639767489235e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c158:12800:13172-13252", + "covariation_status": "passed", + "stage2_posterior": 0.00014600882978173043, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c25:5632:6003-6146", + "covariation_status": "passed", + "stage2_posterior": 0.9949781786495812, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c25:5632:6190-6266", + "covariation_status": "unavailable", + "stage2_posterior": 1.575508634860634e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477455.1:c2:9216:10043-10112", + "covariation_status": "unavailable", + "stage2_posterior": 0.0003954817351227906, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_035477455.1:c2:9216:10127-10240", + "covariation_status": "unavailable", + "stage2_posterior": 6.127439571296198e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_035477455.1:c2:9728:10043-10112", + "covariation_status": "unavailable", + "stage2_posterior": 0.0003954817351227906, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_035477455.1:c2:9728:10127-10276", + "covariation_status": "unavailable", + "stage2_posterior": 0.00018093149413498448, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_035477595.1:c140:13312:13662-13808", + "covariation_status": "failed", + "stage2_posterior": 0.9948993854327781, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477595.1:c140:13312:13825-13942", + "covariation_status": "unavailable", + "stage2_posterior": 9.235607659411139e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477595.1:c175:34816:35339-35488", + "covariation_status": "passed", + "stage2_posterior": 0.9614224576604125, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477595.1:c175:34816:35504-35615", + "covariation_status": "passed", + "stage2_posterior": 1.9426523910791266e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477595.1:c175:35328:35339-35488", + "covariation_status": "passed", + "stage2_posterior": 0.9614224576604125, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_035477595.1:c175:35328:35504-35615", + "covariation_status": "passed", + "stage2_posterior": 1.9426523910791266e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_036675025.1:c237:512:896-978", + "covariation_status": "unavailable", + "stage2_posterior": 7.077180247936106e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_036675025.1:c237:512:994-1140", + "covariation_status": "passed", + "stage2_posterior": 0.9984162855923897, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_038842485.1:c4:10752:11392-11488", + "covariation_status": "unavailable", + "stage2_posterior": 6.553671649701718e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c10:0:153-238", + "covariation_status": "unavailable", + "stage2_posterior": 7.664330101289276e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c10:0:283-374", + "covariation_status": "failed", + "stage2_posterior": 0.0176762172634508, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:11264:11948-12055", + "covariation_status": "failed", + "stage2_posterior": 0.8830442870728273, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:11264:12073-12213", + "covariation_status": "unavailable", + "stage2_posterior": 1.485420377254233e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:11776:11948-12055", + "covariation_status": "failed", + "stage2_posterior": 0.8830442870728273, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:11776:12073-12215", + "covariation_status": "unavailable", + "stage2_posterior": 1.7913379154614466e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:15360:15672-15782", + "covariation_status": "unavailable", + "stage2_posterior": 0.8131505893395139, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:15360:15801-15944", + "covariation_status": "unavailable", + "stage2_posterior": 0.9846324319824724, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:19456:19923-19989", + "covariation_status": "failed", + "stage2_posterior": 0.17941454450731753, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:19456:20129-20282", + "covariation_status": "unavailable", + "stage2_posterior": 0.9897803583297354, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c17:19968:20129-20282", + "covariation_status": "unavailable", + "stage2_posterior": 0.9897803583297354, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c1:62464:63112-63201", + "covariation_status": "unavailable", + "stage2_posterior": 8.512007582091956e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c1:62464:63255-63390", + "covariation_status": "unavailable", + "stage2_posterior": 0.00031981758549421254, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c1:62976:63112-63201", + "covariation_status": "unavailable", + "stage2_posterior": 8.512007582091956e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c1:62976:63255-63384", + "covariation_status": "unavailable", + "stage2_posterior": 2.1759256811383295e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c20:10752:11491-11609", + "covariation_status": "unavailable", + "stage2_posterior": 1.855251926600017e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c20:10752:11628-11713", + "covariation_status": "unavailable", + "stage2_posterior": 0.005920009039083721, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c20:11264:11491-11609", + "covariation_status": "unavailable", + "stage2_posterior": 1.855251926600017e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c20:11264:11628-11713", + "covariation_status": "unavailable", + "stage2_posterior": 0.005920009039083721, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c2:30720:31396-31503", + "covariation_status": "unavailable", + "stage2_posterior": 1.299006650584846e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c2:30720:31524-31629", + "covariation_status": "passed", + "stage2_posterior": 0.5171969449689338, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c2:31232:31396-31503", + "covariation_status": "unavailable", + "stage2_posterior": 1.299006650584846e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c2:31232:31524-31629", + "covariation_status": "passed", + "stage2_posterior": 0.5171969449689338, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c38:14477:15233-15353", + "covariation_status": "passed", + "stage2_posterior": 0.9837153499492078, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c38:14477:15374-15478", + "covariation_status": "unavailable", + "stage2_posterior": 5.656005359171372e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c5:38912:39654-39768", + "covariation_status": "unavailable", + "stage2_posterior": 8.945939341937667e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c5:38912:39795-39893", + "covariation_status": "unavailable", + "stage2_posterior": 0.2350251899184107, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c5:39424:39652-39768", + "covariation_status": "unavailable", + "stage2_posterior": 1.0796668505959581e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c5:39424:39795-39893", + "covariation_status": "unavailable", + "stage2_posterior": 0.2350251899184107, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c5:7168:7460-7600", + "covariation_status": "unavailable", + "stage2_posterior": 0.9989755638555372, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c5:7168:7656-7745", + "covariation_status": "failed", + "stage2_posterior": 0.0031885609469382787, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_039638295.1:c67:3584:3891-3985", + "covariation_status": "failed", + "stage2_posterior": 0.8818906973154067, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c67:3584:4006-4137", + "covariation_status": "unavailable", + "stage2_posterior": 0.4267666112295742, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c67:3924:3929-3985", + "covariation_status": "unavailable", + "stage2_posterior": 0.0001546109349325143, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c67:3924:4006-4137", + "covariation_status": "unavailable", + "stage2_posterior": 0.4267666112295742, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_039638295.1:c72:0:75-164", + "covariation_status": "failed", + "stage2_posterior": 0.0017394016418320491, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1121280:1121812-1121921", + "covariation_status": "passed", + "stage2_posterior": 0.2485902550474453, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1121280:1121949-1122035", + "covariation_status": "unavailable", + "stage2_posterior": 2.7576568188583333e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1121792:1121812-1121921", + "covariation_status": "passed", + "stage2_posterior": 0.2485902550474453, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1121792:1121949-1122035", + "covariation_status": "unavailable", + "stage2_posterior": 2.7576568188583333e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1135616:1136219-1136307", + "covariation_status": "unavailable", + "stage2_posterior": 1.3442337836253656e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1135616:1136323-1136450", + "covariation_status": "unavailable", + "stage2_posterior": 0.0003347083870332227, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1136128:1136219-1136307", + "covariation_status": "unavailable", + "stage2_posterior": 1.3442337836253656e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1136128:1136323-1136449", + "covariation_status": "unavailable", + "stage2_posterior": 0.0002599225123371283, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1162752:1163328-1163412", + "covariation_status": "unavailable", + "stage2_posterior": 0.00022454425607486053, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1162752:1163431-1163586", + "covariation_status": "unavailable", + "stage2_posterior": 0.9990042916563202, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1163264:1163328-1163412", + "covariation_status": "unavailable", + "stage2_posterior": 0.00022454425607486053, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1163264:1163431-1163586", + "covariation_status": "unavailable", + "stage2_posterior": 0.9990042916563202, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1182208:1182818-1182902", + "covariation_status": "unavailable", + "stage2_posterior": 0.08405140849399803, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1182208:1182919-1183043", + "covariation_status": "unavailable", + "stage2_posterior": 7.092265305513223e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1182720:1182818-1182902", + "covariation_status": "unavailable", + "stage2_posterior": 0.08405140849399803, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1182720:1182919-1183043", + "covariation_status": "unavailable", + "stage2_posterior": 7.092265305513223e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1240576:1241294-1241347", + "covariation_status": "unavailable", + "stage2_posterior": 0.00011106080174058097, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1240576:1241371-1241494", + "covariation_status": "unavailable", + "stage2_posterior": 0.1039865465856016, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1241088:1241294-1241347", + "covariation_status": "unavailable", + "stage2_posterior": 0.00011084755096024724, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1241088:1241371-1241494", + "covariation_status": "unavailable", + "stage2_posterior": 0.1039865465856016, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1273856:1274499-1274579", + "covariation_status": "unavailable", + "stage2_posterior": 0.00018494379297421404, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1273856:1274597-1274714", + "covariation_status": "unavailable", + "stage2_posterior": 0.1617702099284459, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1274368:1274499-1274579", + "covariation_status": "unavailable", + "stage2_posterior": 0.00018494379297421404, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:1274368:1274597-1274715", + "covariation_status": "unavailable", + "stage2_posterior": 0.24334047444261186, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:14848:15489-15617", + "covariation_status": "unavailable", + "stage2_posterior": 0.0018769306711562182, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:14848:15644-15722", + "covariation_status": "unavailable", + "stage2_posterior": 1.7638184954730604e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:15360:15489-15617", + "covariation_status": "unavailable", + "stage2_posterior": 0.0018769306711562182, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:15360:15643-15722", + "covariation_status": "unavailable", + "stage2_posterior": 1.690068360290798e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:585728:586376-586510", + "covariation_status": "unavailable", + "stage2_posterior": 1.1480825626798234e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:585728:586529-586603", + "covariation_status": "passed", + "stage2_posterior": 0.00042285286972515055, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:586240:586376-586510", + "covariation_status": "unavailable", + "stage2_posterior": 1.1480825626798234e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:586240:586529-586603", + "covariation_status": "passed", + "stage2_posterior": 0.00042285286972515055, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:634880:635599-635684", + "covariation_status": "unavailable", + "stage2_posterior": 8.288617427442819e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:634880:635709-635783", + "covariation_status": "unavailable", + "stage2_posterior": 8.254260464539054e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:635392:635597-635684", + "covariation_status": "unavailable", + "stage2_posterior": 7.866112977457617e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:635392:635709-635783", + "covariation_status": "unavailable", + "stage2_posterior": 8.254260464539054e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:849408:850177-850250", + "covariation_status": "unavailable", + "stage2_posterior": 0.005003437779817687, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:849920:850069-850148", + "covariation_status": "unavailable", + "stage2_posterior": 6.095663691713896e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c0:849920:850177-850265", + "covariation_status": "unavailable", + "stage2_posterior": 0.00024275938083505855, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c2:131584:132130-132220", + "covariation_status": "unavailable", + "stage2_posterior": 0.9930467054789056, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_040062795.1:c2:221696:222062-222180", + "covariation_status": "unavailable", + "stage2_posterior": 0.11553371465527398, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040062795.1:c2:221696:222196-222270", + "covariation_status": "unavailable", + "stage2_posterior": 1.0292926219204431e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_040905065.1:c256:4899:5781-5916", + "covariation_status": "failed", + "stage2_posterior": 5.8067516406086355e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCA_041616875.1:c30:15872:16518-16611", + "covariation_status": "passed", + "stage2_posterior": 1.047006006380883e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_041616875.1:c30:15872:16630-16813", + "covariation_status": "failed", + "stage2_posterior": 0.9385332001482568, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_041616875.1:c30:16384:16518-16612", + "covariation_status": "passed", + "stage2_posterior": 8.998540338019942e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_041616875.1:c30:16384:16630-16813", + "covariation_status": "failed", + "stage2_posterior": 0.9385332001482568, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_041656455.1:c158:0:219-327", + "covariation_status": "unavailable", + "stage2_posterior": 1.4346439703894798e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_041656455.1:c158:0:61-201", + "covariation_status": "unavailable", + "stage2_posterior": 0.9987583044289611, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_041670175.1:c22:3584:3962-4091", + "covariation_status": "unavailable", + "stage2_posterior": 1.71211581283958e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_041670175.1:c22:3584:4107-4249", + "covariation_status": "unavailable", + "stage2_posterior": 0.8861112415075503, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_041670175.1:c22:4096:4162-4246", + "covariation_status": "unavailable", + "stage2_posterior": 4.3848308805640365e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_045579125.1:c112:5632:6123-6200", + "covariation_status": "unavailable", + "stage2_posterior": 2.4071108687179208e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c112:5632:6218-6360", + "covariation_status": "unavailable", + "stage2_posterior": 0.9974847615875165, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c112:6144:6144-6200", + "covariation_status": "unavailable", + "stage2_posterior": 0.0001533087012223498, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c112:6144:6218-6360", + "covariation_status": "unavailable", + "stage2_posterior": 0.9974847615875165, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c112:8704:9474-9614", + "covariation_status": "unavailable", + "stage2_posterior": 0.9410073340224211, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c112:8704:9628-9690", + "covariation_status": "unavailable", + "stage2_posterior": 6.7899750797229216e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c112:9216:9474-9614", + "covariation_status": "unavailable", + "stage2_posterior": 0.9410073340224211, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c112:9216:9628-9704", + "covariation_status": "unavailable", + "stage2_posterior": 9.233970785738407e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c161:7168:7906-8041", + "covariation_status": "unavailable", + "stage2_posterior": 0.9893100902864195, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c161:7168:8072-8151", + "covariation_status": "unavailable", + "stage2_posterior": 7.908018822960857e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c161:7680:7906-8041", + "covariation_status": "unavailable", + "stage2_posterior": 0.9893100902864195, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c161:7680:8072-8151", + "covariation_status": "unavailable", + "stage2_posterior": 7.908018822960857e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c204:3072:3917-3988", + "covariation_status": "unavailable", + "stage2_posterior": 4.5883905018510285e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c204:3584:3843-3988", + "covariation_status": "unavailable", + "stage2_posterior": 0.9091378167895121, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c204:3584:4022-4116", + "covariation_status": "unavailable", + "stage2_posterior": 1.7446403905305532e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c216:1536:2367-2419", + "covariation_status": "unavailable", + "stage2_posterior": 4.667629998605751e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c216:2048:2348-2420", + "covariation_status": "unavailable", + "stage2_posterior": 6.563675743140519e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c216:2048:2456-2598", + "covariation_status": "unavailable", + "stage2_posterior": 0.9984102568963191, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c51:2048:2600-2674", + "covariation_status": "unavailable", + "stage2_posterior": 1.826356641955496e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c51:2048:2690-2824", + "covariation_status": "unavailable", + "stage2_posterior": 0.9995017927822671, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c51:2560:2600-2674", + "covariation_status": "unavailable", + "stage2_posterior": 1.826356641955496e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_045579125.1:c51:2560:2690-2824", + "covariation_status": "unavailable", + "stage2_posterior": 0.9995017927822671, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_049718665.1:c4:71111:71678-71783", + "covariation_status": "passed", + "stage2_posterior": 0.9963170237970851, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c4:71111:71837-71993", + "covariation_status": "failed", + "stage2_posterior": 0.9980064095542435, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c7:35840:36428-36493", + "covariation_status": "failed", + "stage2_posterior": 1.718658645366294e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c7:35840:36509-36660", + "covariation_status": "unavailable", + "stage2_posterior": 0.9974423192260875, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c7:36352:36428-36493", + "covariation_status": "failed", + "stage2_posterior": 1.718658645366294e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c7:36352:36509-36660", + "covariation_status": "unavailable", + "stage2_posterior": 0.9974423192260875, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c8:16384:16837-16914", + "covariation_status": "failed", + "stage2_posterior": 4.202484264564449e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c8:16384:16929-17096", + "covariation_status": "passed", + "stage2_posterior": 0.9989560923928538, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c8:36864:37621-37776", + "covariation_status": "failed", + "stage2_posterior": 0.9979162542177762, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c8:36864:37830-37886", + "covariation_status": "failed", + "stage2_posterior": 0.0014020008081043114, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c8:37376:37620-37776", + "covariation_status": "failed", + "stage2_posterior": 0.9980064095542435, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_049718665.1:c8:37376:37830-37907", + "covariation_status": "passed", + "stage2_posterior": 0.0052767616563146585, + "synteny_status": "passed" + }, + { + "candidate_id": "GCA_900320995.1:c104:1024:1364-1434", + "covariation_status": "unavailable", + "stage2_posterior": 2.0865942615671035e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c104:1024:1466-1597", + "covariation_status": "unavailable", + "stage2_posterior": 0.9991748785200071, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c145:4096:4581-4656", + "covariation_status": "unavailable", + "stage2_posterior": 2.8198473507935928e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c145:4096:4673-4793", + "covariation_status": "unavailable", + "stage2_posterior": 6.226909178675489e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c145:4608:4673-4791", + "covariation_status": "unavailable", + "stage2_posterior": 9.225412810358216e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c237:1024:1801-1890", + "covariation_status": "unavailable", + "stage2_posterior": 0.00010940105608387507, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c237:1536:1801-1890", + "covariation_status": "unavailable", + "stage2_posterior": 0.00010940105608387507, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c252:0:259-339", + "covariation_status": "failed", + "stage2_posterior": 5.011521738526062e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c252:0:31-223", + "covariation_status": "unavailable", + "stage2_posterior": 0.9960480416086671, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c282:0:254-399", + "covariation_status": "unavailable", + "stage2_posterior": 3.733225367552354e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c45:9216:9809-9893", + "covariation_status": "unavailable", + "stage2_posterior": 5.035883053614053e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c45:9728:9809-9859", + "covariation_status": "unavailable", + "stage2_posterior": 6.539068730250723e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c45:9799:9810-9861", + "covariation_status": "unavailable", + "stage2_posterior": 6.0774027633275125e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c59:11264:11555-11641", + "covariation_status": "unavailable", + "stage2_posterior": 3.467583493722234e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c59:11264:11745-11898", + "covariation_status": "unavailable", + "stage2_posterior": 0.9796447291827755, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c59:7168:7931-7991", + "covariation_status": "unavailable", + "stage2_posterior": 2.3610852810060955e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c59:7680:7899-7992", + "covariation_status": "unavailable", + "stage2_posterior": 2.6522684373870845e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c59:7680:8094-8242", + "covariation_status": "unavailable", + "stage2_posterior": 0.018109960440788764, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c88:4608:5316-5394", + "covariation_status": "unavailable", + "stage2_posterior": 5.463956031591022e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c88:5120:5291-5448", + "covariation_status": "unavailable", + "stage2_posterior": 0.0021411515035463908, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_900320995.1:c88:5120:5465-5702", + "covariation_status": "unavailable", + "stage2_posterior": 0.9994621172622699, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c109:4096:4745-4896", + "covariation_status": "unavailable", + "stage2_posterior": 0.9949452017087684, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c109:4096:4929-5030", + "covariation_status": "unavailable", + "stage2_posterior": 1.709778389031372e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c109:4608:4745-4896", + "covariation_status": "unavailable", + "stage2_posterior": 0.9949452017087684, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c109:4608:4928-5032", + "covariation_status": "unavailable", + "stage2_posterior": 1.6255700186782228e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c162:1024:1367-1520", + "covariation_status": "unavailable", + "stage2_posterior": 0.9950877870129453, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c162:512:1367-1516", + "covariation_status": "unavailable", + "stage2_posterior": 0.9741793024342854, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c17:22528:23175-23329", + "covariation_status": "unavailable", + "stage2_posterior": 0.9995702066523647, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c17:22528:23347-23424", + "covariation_status": "unavailable", + "stage2_posterior": 2.797702614144178e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c17:23040:23175-23329", + "covariation_status": "unavailable", + "stage2_posterior": 0.9995702066523647, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c17:23040:23347-23424", + "covariation_status": "unavailable", + "stage2_posterior": 2.797702614144178e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c204:1339:2033-2167", + "covariation_status": "unavailable", + "stage2_posterior": 1.2987525325810358e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c204:1339:2184-2269", + "covariation_status": "unavailable", + "stage2_posterior": 1.7864037968316798e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c231:0:507-601", + "covariation_status": "unavailable", + "stage2_posterior": 1.717851275049225e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c231:0:633-777", + "covariation_status": "unavailable", + "stage2_posterior": 0.9907781712041599, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c231:512:513-601", + "covariation_status": "unavailable", + "stage2_posterior": 1.1798035783488383e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c231:512:633-777", + "covariation_status": "unavailable", + "stage2_posterior": 0.9907781712041599, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c31:7680:8302-8385", + "covariation_status": "failed", + "stage2_posterior": 2.5492765109793968e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c31:7680:8404-8532", + "covariation_status": "unavailable", + "stage2_posterior": 1.4410900383880064e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c31:8192:8302-8385", + "covariation_status": "failed", + "stage2_posterior": 2.5492765109793968e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c31:8192:8404-8532", + "covariation_status": "unavailable", + "stage2_posterior": 1.4410900383880064e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c37:1024:1864-1956", + "covariation_status": "unavailable", + "stage2_posterior": 0.0007319062607580898, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c37:1536:1862-2009", + "covariation_status": "unavailable", + "stage2_posterior": 0.9933893031635508, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c37:1536:2025-2124", + "covariation_status": "unavailable", + "stage2_posterior": 1.9924264007666607e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c42:11776:12603-12685", + "covariation_status": "unavailable", + "stage2_posterior": 7.247153849445613e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c42:12288:12597-12739", + "covariation_status": "unavailable", + "stage2_posterior": 0.9982347645219614, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c42:12288:12777-12868", + "covariation_status": "unavailable", + "stage2_posterior": 1.038010857029909e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c57:3584:3955-4071", + "covariation_status": "unavailable", + "stage2_posterior": 1.6200925363426077e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c57:3584:4089-4190", + "covariation_status": "unavailable", + "stage2_posterior": 1.335098487654468e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c59:5632:5929-6015", + "covariation_status": "unavailable", + "stage2_posterior": 8.596679023142232e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_934527255.1:c59:5632:6065-6207", + "covariation_status": "unavailable", + "stage2_posterior": 0.9943664231281049, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_937860145.1:c200:25088:25724-25860", + "covariation_status": "unavailable", + "stage2_posterior": 0.0002565363229849966, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_937860145.1:c200:25088:25876-26008", + "covariation_status": "passed", + "stage2_posterior": 0.9863774816238554, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_937860145.1:c200:25600:25724-25860", + "covariation_status": "unavailable", + "stage2_posterior": 0.0002565363229849966, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_937860145.1:c200:25600:25876-26008", + "covariation_status": "passed", + "stage2_posterior": 0.9863774816238554, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_937871925.1:c103:0:267-387", + "covariation_status": "unavailable", + "stage2_posterior": 3.34416739977973e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_937871925.1:c103:0:402-491", + "covariation_status": "passed", + "stage2_posterior": 0.3836398336233293, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_937871925.1:c103:126:267-387", + "covariation_status": "unavailable", + "stage2_posterior": 3.34416739977973e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_937871925.1:c103:126:402-491", + "covariation_status": "passed", + "stage2_posterior": 0.3836398336233293, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c165:14336:14744-14892", + "covariation_status": "passed", + "stage2_posterior": 0.9993808756906332, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c165:14336:14908-14979", + "covariation_status": "passed", + "stage2_posterior": 1.7327854619588576e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c207:10240:10890-10964", + "covariation_status": "passed", + "stage2_posterior": 8.280325440871366e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c207:10240:11021-11176", + "covariation_status": "failed", + "stage2_posterior": 0.9977457701372398, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c207:10752:10890-10964", + "covariation_status": "passed", + "stage2_posterior": 8.280325440871366e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c207:10752:11021-11176", + "covariation_status": "failed", + "stage2_posterior": 0.9977457701372398, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c242:1536:2202-2341", + "covariation_status": "passed", + "stage2_posterior": 0.9992276710092153, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c242:1536:2356-2440", + "covariation_status": "passed", + "stage2_posterior": 2.041479408192533e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c242:2048:2202-2341", + "covariation_status": "passed", + "stage2_posterior": 0.9992276710092153, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_938039765.1:c242:2048:2356-2440", + "covariation_status": "passed", + "stage2_posterior": 2.041479408192533e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c108:3072:3784-3881", + "covariation_status": "unavailable", + "stage2_posterior": 4.137617263844531e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c108:3072:3897-4050", + "covariation_status": "unavailable", + "stage2_posterior": 0.9969666390674308, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c108:3584:3784-3881", + "covariation_status": "unavailable", + "stage2_posterior": 4.137617263844531e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c108:3584:3897-4050", + "covariation_status": "unavailable", + "stage2_posterior": 0.9969666390674308, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c139:4096:4652-4737", + "covariation_status": "unavailable", + "stage2_posterior": 6.119524377720892e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c139:4096:4772-4933", + "covariation_status": "unavailable", + "stage2_posterior": 0.272559835362412, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c139:4608:4655-4737", + "covariation_status": "unavailable", + "stage2_posterior": 5.922496648624559e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c139:4608:4772-4831", + "covariation_status": "unavailable", + "stage2_posterior": 6.3983255844109735e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c15:36352:36873-37032", + "covariation_status": "unavailable", + "stage2_posterior": 0.00012445217609403158, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c15:36352:37050-37150", + "covariation_status": "unavailable", + "stage2_posterior": 1.610555018812594e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c15:36864:36873-37032", + "covariation_status": "unavailable", + "stage2_posterior": 0.00012445217609403158, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c15:36864:37050-37150", + "covariation_status": "unavailable", + "stage2_posterior": 1.610555018812594e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c54:4096:4542-4628", + "covariation_status": "unavailable", + "stage2_posterior": 2.0032954771754517e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c54:4096:4666-4812", + "covariation_status": "unavailable", + "stage2_posterior": 0.9922499002434434, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c54:4608:4666-4812", + "covariation_status": "unavailable", + "stage2_posterior": 0.9922499002434434, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c57:2048:2420-2503", + "covariation_status": "unavailable", + "stage2_posterior": 1.6434626131751555e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_946403625.1:c57:2048:2526-2686", + "covariation_status": "unavailable", + "stage2_posterior": 0.0006148951766460623, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949300325.1:c1:42496:43132-43272", + "covariation_status": "unavailable", + "stage2_posterior": 0.996918888163992, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949300325.1:c1:42496:43287-43389", + "covariation_status": "unavailable", + "stage2_posterior": 1.8660200505499957e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949300325.1:c1:43008:43132-43271", + "covariation_status": "unavailable", + "stage2_posterior": 0.996626579082441, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949300325.1:c1:43008:43287-43389", + "covariation_status": "unavailable", + "stage2_posterior": 1.8660200505499957e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c12:2048:2760-2840", + "covariation_status": "passed", + "stage2_posterior": 1.908109201868969e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c12:2048:2858-3039", + "covariation_status": "unavailable", + "stage2_posterior": 0.9945398838403644, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c12:2560:2760-2840", + "covariation_status": "passed", + "stage2_posterior": 1.908109201868969e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c12:2560:2858-3039", + "covariation_status": "unavailable", + "stage2_posterior": 0.9945398838403644, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c132:0:451-543", + "covariation_status": "unavailable", + "stage2_posterior": 4.401035052249248e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c132:0:564-714", + "covariation_status": "unavailable", + "stage2_posterior": 0.9972743737070239, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c212:6656:7082-7160", + "covariation_status": "unavailable", + "stage2_posterior": 2.539028145690011e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c212:6656:7202-7371", + "covariation_status": "unavailable", + "stage2_posterior": 0.9983848089298809, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c212:7168:7252-7371", + "covariation_status": "unavailable", + "stage2_posterior": 0.9537745231638409, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c238:0:713-788", + "covariation_status": "unavailable", + "stage2_posterior": 0.00012559634041369336, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c238:0:806-1004", + "covariation_status": "unavailable", + "stage2_posterior": 0.9992485139389216, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c238:512:713-788", + "covariation_status": "unavailable", + "stage2_posterior": 0.00012559634041369336, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c238:512:806-1008", + "covariation_status": "unavailable", + "stage2_posterior": 0.9994206013760571, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c256:512:1298-1353", + "covariation_status": "unavailable", + "stage2_posterior": 5.572844893122977e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c306:1024:1459-1683", + "covariation_status": "unavailable", + "stage2_posterior": 0.9982757949665494, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c306:1024:1745-1829", + "covariation_status": "unavailable", + "stage2_posterior": 1.0449639676148108e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c306:1324:1459-1683", + "covariation_status": "unavailable", + "stage2_posterior": 0.9982757949665494, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c306:1324:1745-1829", + "covariation_status": "unavailable", + "stage2_posterior": 1.0449639676148108e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c308:1024:1354-1452", + "covariation_status": "unavailable", + "stage2_posterior": 1.8912702248555362e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c308:1024:1467-1671", + "covariation_status": "unavailable", + "stage2_posterior": 0.9985211730846971, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c9:0:361-459", + "covariation_status": "unavailable", + "stage2_posterior": 4.517390532366589e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_949740745.1:c9:0:486-664", + "covariation_status": "unavailable", + "stage2_posterior": 0.9986484764839108, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_963813295.1:c8:55808:56584-56638", + "covariation_status": "unavailable", + "stage2_posterior": 6.223921500333338e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_963813295.1:c8:56320:56584-56642", + "covariation_status": "unavailable", + "stage2_posterior": 7.160315677073373e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_963815215.1:c2:216576:217221-217280", + "covariation_status": "unavailable", + "stage2_posterior": 4.681838353146428e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_963815215.1:c2:216576:217337-217498", + "covariation_status": "failed", + "stage2_posterior": 2.394497305172284e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_963815215.1:c2:217088:217215-217280", + "covariation_status": "unavailable", + "stage2_posterior": 4.304043137620019e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_963815215.1:c2:217088:217337-217498", + "covariation_status": "failed", + "stage2_posterior": 2.394497305172284e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_963846575.1:c1:225280:225742-225884", + "covariation_status": "passed", + "stage2_posterior": 0.9948865240900676, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_963846575.1:c1:225280:225901-225995", + "covariation_status": "passed", + "stage2_posterior": 9.180170126197813e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c0:173056:173624-173740", + "covariation_status": "unavailable", + "stage2_posterior": 0.0003657427007453742, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c0:173056:173757-173861", + "covariation_status": "unavailable", + "stage2_posterior": 1.0640896564097972e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c0:173568:173624-173740", + "covariation_status": "unavailable", + "stage2_posterior": 0.0003657427007453742, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c0:173568:173757-173861", + "covariation_status": "unavailable", + "stage2_posterior": 1.0631639107709887e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c25:44032:44799-44942", + "covariation_status": "unavailable", + "stage2_posterior": 0.037748719578970774, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c25:44032:44959-45053", + "covariation_status": "unavailable", + "stage2_posterior": 2.2510247517286445e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c25:44544:44799-44942", + "covariation_status": "unavailable", + "stage2_posterior": 0.037748719578970774, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c25:44544:44959-45077", + "covariation_status": "unavailable", + "stage2_posterior": 4.289614872221419e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c7:40448:40865-41025", + "covariation_status": "unavailable", + "stage2_posterior": 0.9977896155816717, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c7:40448:41082-41185", + "covariation_status": "unavailable", + "stage2_posterior": 1.4913375375392358e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c9:69120:69712-69814", + "covariation_status": "failed", + "stage2_posterior": 6.042306395258616e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c9:69120:69832-69953", + "covariation_status": "unavailable", + "stage2_posterior": 3.6338076193724754e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c9:69632:69712-69814", + "covariation_status": "failed", + "stage2_posterior": 6.042306395258616e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964236795.1:c9:69632:69832-69953", + "covariation_status": "unavailable", + "stage2_posterior": 3.6338076193724754e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964293175.1:c117:1536:2026-2172", + "covariation_status": "unavailable", + "stage2_posterior": 0.9952996974167015, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964293175.1:c117:1536:2190-2319", + "covariation_status": "unavailable", + "stage2_posterior": 3.6311077493553985e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964293175.1:c117:2048:2058-2172", + "covariation_status": "unavailable", + "stage2_posterior": 5.605017437298478e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964293175.1:c117:2048:2190-2319", + "covariation_status": "unavailable", + "stage2_posterior": 3.6311077493553985e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c0:47104:47727-47845", + "covariation_status": "unavailable", + "stage2_posterior": 0.0017449234988138255, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c0:47104:47859-47931", + "covariation_status": "failed", + "stage2_posterior": 0.0030843018630844735, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c0:47616:47728-47845", + "covariation_status": "unavailable", + "stage2_posterior": 0.0065426176061919, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c0:47616:47859-47931", + "covariation_status": "failed", + "stage2_posterior": 0.0030843018630844735, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c12:9728:10234-10320", + "covariation_status": "unavailable", + "stage2_posterior": 0.0034143868297448685, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c12:9728:10335-10408", + "covariation_status": "unavailable", + "stage2_posterior": 0.8593224324921156, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c14:1024:1605-1715", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988161062128275, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c14:1024:1729-1796", + "covariation_status": "failed", + "stage2_posterior": 0.009400772351333919, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c14:1536:1605-1712", + "covariation_status": "unavailable", + "stage2_posterior": 0.9984564682077522, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c14:1536:1729-1796", + "covariation_status": "failed", + "stage2_posterior": 0.009400772351333919, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c15:7168:7918-8030", + "covariation_status": "unavailable", + "stage2_posterior": 0.019466649520167165, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c15:7680:7918-8030", + "covariation_status": "unavailable", + "stage2_posterior": 0.019466649520167165, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c16:10240:10588-10693", + "covariation_status": "unavailable", + "stage2_posterior": 0.0026512983927002775, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c16:10240:10708-10780", + "covariation_status": "failed", + "stage2_posterior": 0.002984471420005381, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c16:12800:13246-13339", + "covariation_status": "unavailable", + "stage2_posterior": 9.131527482671555e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c16:12800:13355-13437", + "covariation_status": "unavailable", + "stage2_posterior": 6.284092097983271e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c27:6656:7417-7528", + "covariation_status": "unavailable", + "stage2_posterior": 0.9962707552640458, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c27:7168:7417-7529", + "covariation_status": "unavailable", + "stage2_posterior": 0.9945721380513208, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c47:3072:3689-3795", + "covariation_status": "unavailable", + "stage2_posterior": 0.2545716875903292, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c47:3584:3689-3795", + "covariation_status": "unavailable", + "stage2_posterior": 0.2545716875903292, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c5:3584:3959-4042", + "covariation_status": "unavailable", + "stage2_posterior": 0.001581591310185735, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964371705.1:c6:14848:15313-15446", + "covariation_status": "unavailable", + "stage2_posterior": 0.9992263477754906, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c114:2048:2550-2695", + "covariation_status": "unavailable", + "stage2_posterior": 1.1311683094432184e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c114:2048:2716-2793", + "covariation_status": "unavailable", + "stage2_posterior": 1.3370243007074254e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c158:1024:1821-1900", + "covariation_status": "failed", + "stage2_posterior": 6.766626872845188e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c158:1024:1926-1997", + "covariation_status": "unavailable", + "stage2_posterior": 3.994607238511768e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c158:1536:1821-1900", + "covariation_status": "failed", + "stage2_posterior": 6.766626872845188e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c158:1536:1926-2066", + "covariation_status": "unavailable", + "stage2_posterior": 0.9446646668874465, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c172:3072:3712-3857", + "covariation_status": "unavailable", + "stage2_posterior": 0.6321349900722671, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c172:3072:3874-3940", + "covariation_status": "unavailable", + "stage2_posterior": 8.503284181573227e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c172:3559:3712-3857", + "covariation_status": "unavailable", + "stage2_posterior": 0.6321349900722671, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c172:3559:3874-3940", + "covariation_status": "unavailable", + "stage2_posterior": 8.503284181573227e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c237:1024:1044-1117", + "covariation_status": "unavailable", + "stage2_posterior": 9.93759765950304e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c237:512:1044-1144", + "covariation_status": "unavailable", + "stage2_posterior": 1.5365273853474026e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c237:512:1159-1249", + "covariation_status": "unavailable", + "stage2_posterior": 6.839213685935823e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c25:12922:13695-13772", + "covariation_status": "unavailable", + "stage2_posterior": 5.932527472467087e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c25:12922:13788-13909", + "covariation_status": "unavailable", + "stage2_posterior": 5.4049385333795585e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c51:2048:2367-2456", + "covariation_status": "unavailable", + "stage2_posterior": 6.0105380336005655e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c51:2048:2483-2618", + "covariation_status": "unavailable", + "stage2_posterior": 0.005717931080725248, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c52:1536:1826-1878", + "covariation_status": "unavailable", + "stage2_posterior": 2.2903984596547872e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c70:7472:8216-8300", + "covariation_status": "unavailable", + "stage2_posterior": 6.486587057096813e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964396465.1:c70:7472:8329-8409", + "covariation_status": "failed", + "stage2_posterior": 9.135767998673428e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964452225.1:c293:0:449-501", + "covariation_status": "unavailable", + "stage2_posterior": 1.1067431523639566e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964452225.1:c361:1024:1757-1926", + "covariation_status": "unavailable", + "stage2_posterior": 1.0101139636541503e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964452225.1:c361:1024:1986-2045", + "covariation_status": "unavailable", + "stage2_posterior": 1.6660244161777442e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964452225.1:c361:1374:1757-1926", + "covariation_status": "unavailable", + "stage2_posterior": 1.0101139636541503e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964452225.1:c361:1374:1986-2095", + "covariation_status": "unavailable", + "stage2_posterior": 0.00014900968998464423, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964452225.1:c89:4608:5273-5437", + "covariation_status": "unavailable", + "stage2_posterior": 1.7616652796724624e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964452225.1:c89:4608:5498-5561", + "covariation_status": "unavailable", + "stage2_posterior": 5.826038433110267e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964452225.1:c89:5120:5282-5437", + "covariation_status": "unavailable", + "stage2_posterior": 7.054329631727127e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c1:0:227-381", + "covariation_status": "unavailable", + "stage2_posterior": 0.5363943570696171, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c1:0:436-522", + "covariation_status": "unavailable", + "stage2_posterior": 1.2128065576060054e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c4:49664:50316-50401", + "covariation_status": "unavailable", + "stage2_posterior": 5.571586994597773e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c4:49664:50420-50514", + "covariation_status": "unavailable", + "stage2_posterior": 5.429051449654895e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c4:50176:50316-50401", + "covariation_status": "unavailable", + "stage2_posterior": 5.571586994597773e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c4:50176:50420-50514", + "covariation_status": "unavailable", + "stage2_posterior": 5.429051449654895e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c4:79360:79984-80133", + "covariation_status": "unavailable", + "stage2_posterior": 1.0486617989760777e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c4:79360:80167-80250", + "covariation_status": "passed", + "stage2_posterior": 3.6820726708479346e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c4:79872:79984-80133", + "covariation_status": "unavailable", + "stage2_posterior": 1.0486617989760777e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c4:79872:80167-80250", + "covariation_status": "passed", + "stage2_posterior": 3.6820726708479346e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c94:2560:3198-3323", + "covariation_status": "unavailable", + "stage2_posterior": 0.4477081009662876, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c94:2560:3339-3423", + "covariation_status": "unavailable", + "stage2_posterior": 1.6403436881934294e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c94:3072:3198-3323", + "covariation_status": "unavailable", + "stage2_posterior": 0.4477081009662876, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c94:3072:3339-3423", + "covariation_status": "unavailable", + "stage2_posterior": 1.6403436881934294e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c97:1024:1699-1846", + "covariation_status": "unavailable", + "stage2_posterior": 0.006115036751169255, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c97:1024:1861-1936", + "covariation_status": "unavailable", + "stage2_posterior": 6.761575660867164e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c97:1536:1699-1846", + "covariation_status": "unavailable", + "stage2_posterior": 0.006115036751169255, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964469045.1:c97:1536:1861-1936", + "covariation_status": "unavailable", + "stage2_posterior": 6.761575660867164e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964472775.1:c275:1024:1431-1513", + "covariation_status": "unavailable", + "stage2_posterior": 6.747615158522861e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964472775.1:c275:1024:1576-1772", + "covariation_status": "unavailable", + "stage2_posterior": 0.000622289095535177, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_964472775.1:c275:1536:1624-1771", + "covariation_status": "unavailable", + "stage2_posterior": 5.127595202911609e-06, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_965214405.1:c0:2088960:2089301-2089450", + "covariation_status": "unavailable", + "stage2_posterior": 0.000498958030389321, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCA_965214405.1:c0:2088960:2089501-2089579", + "covariation_status": "unavailable", + "stage2_posterior": 1.762421037361813e-05, + "synteny_status": "unavailable" + }, + { + "candidate_id": "GCF_000020965.1:c0:1037312:1038082-1038221", + "covariation_status": "passed", + "stage2_posterior": 0.9992276710092153, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:1037312:1038236-1038320", + "covariation_status": "passed", + "stage2_posterior": 2.041479408192533e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:1037824:1038082-1038221", + "covariation_status": "passed", + "stage2_posterior": 0.9992276710092153, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:1037824:1038236-1038320", + "covariation_status": "passed", + "stage2_posterior": 2.041479408192533e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:1115648:1116415-1116496", + "covariation_status": "failed", + "stage2_posterior": 0.035936759707462136, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:1115648:1116513-1116655", + "covariation_status": "unavailable", + "stage2_posterior": 0.998771297732612, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:1116160:1116415-1116496", + "covariation_status": "failed", + "stage2_posterior": 0.035936759707462136, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:1116160:1116513-1116655", + "covariation_status": "unavailable", + "stage2_posterior": 0.998771297732612, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:529408:529990-530145", + "covariation_status": "passed", + "stage2_posterior": 0.9969705342375452, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:529408:530202-530282", + "covariation_status": "passed", + "stage2_posterior": 0.00016381161070619485, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:529920:529990-530145", + "covariation_status": "passed", + "stage2_posterior": 0.9969705342375452, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:529920:530202-530282", + "covariation_status": "passed", + "stage2_posterior": 0.00016381161070619485, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:875008:875778-875931", + "covariation_status": "unavailable", + "stage2_posterior": 0.9991378806916809, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:875008:875947-876019", + "covariation_status": "passed", + "stage2_posterior": 0.0010955445176783153, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:875520:875778-875931", + "covariation_status": "unavailable", + "stage2_posterior": 0.9991378806916809, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000020965.1:c0:875520:875947-876019", + "covariation_status": "passed", + "stage2_posterior": 0.0010955445176783153, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1042432:1043159-1043309", + "covariation_status": "unavailable", + "stage2_posterior": 0.9992728479136682, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1042432:1043325-1043402", + "covariation_status": "passed", + "stage2_posterior": 0.002087777964622643, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1042944:1043159-1043309", + "covariation_status": "unavailable", + "stage2_posterior": 0.9992728479136682, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1042944:1043325-1043402", + "covariation_status": "passed", + "stage2_posterior": 0.002087777964622643, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1204224:1205048-1205182", + "covariation_status": "passed", + "stage2_posterior": 0.9989595819852981, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1204736:1205043-1205182", + "covariation_status": "passed", + "stage2_posterior": 0.9990593690513064, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1204736:1205197-1205280", + "covariation_status": "failed", + "stage2_posterior": 4.057008457338867e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1278976:1279734-1279815", + "covariation_status": "failed", + "stage2_posterior": 0.022450814641262085, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1278976:1279832-1279974", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988398877728464, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1279488:1279734-1279815", + "covariation_status": "failed", + "stage2_posterior": 0.022450814641262085, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:1279488:1279832-1279974", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988398877728464, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:700416:700923-701078", + "covariation_status": "failed", + "stage2_posterior": 0.9978204529717433, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:700416:701135-701215", + "covariation_status": "passed", + "stage2_posterior": 5.6173162474769694e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:700928:700931-701078", + "covariation_status": "failed", + "stage2_posterior": 0.9965990720086491, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000021645.1:c0:700928:701136-701215", + "covariation_status": "passed", + "stage2_posterior": 6.099869549405531e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000024405.1:c0:426496:427333-427387", + "covariation_status": "unavailable", + "stage2_posterior": 5.447003456026524e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000024405.1:c0:427008:427331-427478", + "covariation_status": "unavailable", + "stage2_posterior": 0.9990152071151926, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000024405.1:c0:427008:427511-427611", + "covariation_status": "unavailable", + "stage2_posterior": 9.422148498092787e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000183745.1:c1:1170944:1171671-1171745", + "covariation_status": "unavailable", + "stage2_posterior": 4.638472615261016e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000183745.1:c1:1170944:1171775-1171899", + "covariation_status": "failed", + "stage2_posterior": 1.2956387437465801e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000183745.1:c1:1171456:1171666-1171745", + "covariation_status": "unavailable", + "stage2_posterior": 4.760061186768604e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000183745.1:c1:1171456:1171769-1171901", + "covariation_status": "passed", + "stage2_posterior": 1.4027274454117427e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000212395.1:c0:548864:549565-549698", + "covariation_status": "passed", + "stage2_posterior": 0.993606586786443, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000212395.1:c0:548864:549713-549789", + "covariation_status": "unavailable", + "stage2_posterior": 4.692531095333409e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000212395.1:c0:549376:549565-549698", + "covariation_status": "passed", + "stage2_posterior": 0.993606586786443, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000212395.1:c0:549376:549713-549789", + "covariation_status": "unavailable", + "stage2_posterior": 4.692531095333409e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000373205.1:c16:29696:30446-30502", + "covariation_status": "unavailable", + "stage2_posterior": 7.465594536218865e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000373205.1:c16:29696:30518-30640", + "covariation_status": "unavailable", + "stage2_posterior": 1.890607795370761e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000373205.1:c16:30208:30446-30502", + "covariation_status": "unavailable", + "stage2_posterior": 7.465594536218865e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000373205.1:c16:30208:30518-30643", + "covariation_status": "unavailable", + "stage2_posterior": 1.2936513953089271e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000373205.1:c16:42496:42930-43018", + "covariation_status": "unavailable", + "stage2_posterior": 1.5847021401412485e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000373205.1:c16:42496:43092-43182", + "covariation_status": "unavailable", + "stage2_posterior": 5.774430111825988e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000381045.1:c8:56832:57300-57385", + "covariation_status": "unavailable", + "stage2_posterior": 6.759851627093838e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000381045.1:c8:56832:57404-57554", + "covariation_status": "failed", + "stage2_posterior": 0.31448361199940245, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000381045.1:c8:57344:57404-57554", + "covariation_status": "failed", + "stage2_posterior": 0.31448361199940245, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000744885.1:c2:1299968:1300450-1300597", + "covariation_status": "failed", + "stage2_posterior": 2.599203005156825e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000744885.1:c2:1299968:1300614-1300698", + "covariation_status": "unavailable", + "stage2_posterior": 1.0323159643730704e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000744885.1:c2:1300480:1300511-1300597", + "covariation_status": "unavailable", + "stage2_posterior": 7.710720156955151e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_000744885.1:c2:1300480:1300614-1300698", + "covariation_status": "unavailable", + "stage2_posterior": 1.0323159643730704e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:1541632:1542174-1542329", + "covariation_status": "unavailable", + "stage2_posterior": 0.9958752218066772, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:1541632:1542344-1542446", + "covariation_status": "unavailable", + "stage2_posterior": 1.811927461547673e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:1542144:1542174-1542329", + "covariation_status": "unavailable", + "stage2_posterior": 0.9958752218066772, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:1542144:1542344-1542446", + "covariation_status": "unavailable", + "stage2_posterior": 1.8148945837370034e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:1655296:1655593-1655765", + "covariation_status": "unavailable", + "stage2_posterior": 0.9992589942615895, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:1655296:1655782-1655883", + "covariation_status": "failed", + "stage2_posterior": 7.312604762698538e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2273280:2273813-2273972", + "covariation_status": "unavailable", + "stage2_posterior": 0.9739895569272788, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2273280:2273990-2274105", + "covariation_status": "unavailable", + "stage2_posterior": 1.9160288698132796e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2273792:2273813-2273972", + "covariation_status": "unavailable", + "stage2_posterior": 0.9739895569272788, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2273792:2273990-2274105", + "covariation_status": "unavailable", + "stage2_posterior": 1.9160288698132796e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2412544:2413292-2413447", + "covariation_status": "unavailable", + "stage2_posterior": 0.9991382450325877, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2412544:2413463-2413568", + "covariation_status": "passed", + "stage2_posterior": 6.942840029656037e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2413056:2413292-2413447", + "covariation_status": "unavailable", + "stage2_posterior": 0.9991382450325877, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2413056:2413463-2413568", + "covariation_status": "passed", + "stage2_posterior": 6.942840029656037e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2467840:2468475-2468575", + "covariation_status": "unavailable", + "stage2_posterior": 2.440192664049452e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2467840:2468591-2468688", + "covariation_status": "failed", + "stage2_posterior": 0.010540453418679738, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2468352:2468475-2468575", + "covariation_status": "unavailable", + "stage2_posterior": 2.440192664049452e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2468352:2468591-2468688", + "covariation_status": "failed", + "stage2_posterior": 0.010540453418679738, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2503680:2504241-2504537", + "covariation_status": "unavailable", + "stage2_posterior": 0.9973477961044462, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2504192:2504241-2504362", + "covariation_status": "unavailable", + "stage2_posterior": 0.061787473835226224, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2504192:2504377-2504537", + "covariation_status": "unavailable", + "stage2_posterior": 0.09380155403346968, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2712064:2712808-2712892", + "covariation_status": "passed", + "stage2_posterior": 0.000907220493023052, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2712064:2712908-2713039", + "covariation_status": "unavailable", + "stage2_posterior": 0.01445201590412965, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2712576:2712808-2712892", + "covariation_status": "passed", + "stage2_posterior": 0.000907220493023052, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2712576:2712908-2713039", + "covariation_status": "unavailable", + "stage2_posterior": 0.01445201590412965, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2871808:2872436-2872574", + "covariation_status": "unavailable", + "stage2_posterior": 0.9989160913017363, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2871808:2872612-2872683", + "covariation_status": "passed", + "stage2_posterior": 0.00020675066720349174, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2872320:2872436-2872574", + "covariation_status": "unavailable", + "stage2_posterior": 0.9989160913017363, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2872320:2872612-2872683", + "covariation_status": "passed", + "stage2_posterior": 0.00020675066720349174, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2873344:2873617-2873756", + "covariation_status": "unavailable", + "stage2_posterior": 0.9983430184217857, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:2873344:2873801-2873877", + "covariation_status": "unavailable", + "stage2_posterior": 6.1342929837613474e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3105280:3105987-3106136", + "covariation_status": "unavailable", + "stage2_posterior": 0.9930416578834355, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3105280:3106184-3106275", + "covariation_status": "unavailable", + "stage2_posterior": 1.3115601046557342e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3105792:3105987-3106136", + "covariation_status": "unavailable", + "stage2_posterior": 0.9930416578834355, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3105792:3106184-3106275", + "covariation_status": "unavailable", + "stage2_posterior": 1.3115601046557342e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3516416:3516906-3516994", + "covariation_status": "unavailable", + "stage2_posterior": 0.0001077022546722214, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3516416:3517009-3517160", + "covariation_status": "unavailable", + "stage2_posterior": 0.8159236595318196, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3516928:3517009-3517150", + "covariation_status": "unavailable", + "stage2_posterior": 0.0022366678035500493, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3821568:3822355-3822435", + "covariation_status": "unavailable", + "stage2_posterior": 8.23789528197347e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3821568:3822449-3822592", + "covariation_status": "unavailable", + "stage2_posterior": 0.00031112353243306965, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3822080:3822355-3822435", + "covariation_status": "unavailable", + "stage2_posterior": 8.23789528197347e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3822080:3822449-3822598", + "covariation_status": "unavailable", + "stage2_posterior": 7.398704097425515e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3899904:3900479-3900612", + "covariation_status": "unavailable", + "stage2_posterior": 0.0007469348448927408, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3899904:3900650-3900800", + "covariation_status": "unavailable", + "stage2_posterior": 0.9985769952951035, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3900416:3900479-3900612", + "covariation_status": "unavailable", + "stage2_posterior": 0.0007469348448927408, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:3900416:3900650-3900800", + "covariation_status": "unavailable", + "stage2_posterior": 0.9985769952951035, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4380160:4380920-4381018", + "covariation_status": "unavailable", + "stage2_posterior": 3.0424734367586722e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4380160:4381036-4381167", + "covariation_status": "unavailable", + "stage2_posterior": 1.3959696895520036e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4380672:4380920-4381018", + "covariation_status": "unavailable", + "stage2_posterior": 3.0424734367586722e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4380672:4381036-4381167", + "covariation_status": "unavailable", + "stage2_posterior": 1.3959696895520036e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4627968:4628619-4628706", + "covariation_status": "failed", + "stage2_posterior": 2.392254134107287e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4627968:4628725-4628883", + "covariation_status": "unavailable", + "stage2_posterior": 1.5379913159360264e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4628480:4628618-4628706", + "covariation_status": "passed", + "stage2_posterior": 2.732717586351324e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4628480:4628725-4628887", + "covariation_status": "unavailable", + "stage2_posterior": 1.639008427102371e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4644864:4645676-4645743", + "covariation_status": "unavailable", + "stage2_posterior": 0.00021052151662083875, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4644864:4645760-4645851", + "covariation_status": "unavailable", + "stage2_posterior": 4.699851985713205e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4645376:4645646-4645743", + "covariation_status": "unavailable", + "stage2_posterior": 0.0003643614816457236, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4645376:4645760-4645939", + "covariation_status": "unavailable", + "stage2_posterior": 0.987055219758166, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4695040:4695758-4695852", + "covariation_status": "passed", + "stage2_posterior": 0.0010023333814969352, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4695040:4695867-4696021", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988936165211141, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4695552:4695758-4695852", + "covariation_status": "passed", + "stage2_posterior": 0.0010023333814969352, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4695552:4695867-4696021", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988936165211141, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4868608:4869028-4869161", + "covariation_status": "unavailable", + "stage2_posterior": 0.001989182023458161, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4868608:4869176-4869334", + "covariation_status": "unavailable", + "stage2_posterior": 0.9995075349435144, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:4869120:4869243-4869334", + "covariation_status": "unavailable", + "stage2_posterior": 3.204222742357763e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5002240:5002494-5002606", + "covariation_status": "passed", + "stage2_posterior": 0.022646247812540096, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5002240:5002657-5002820", + "covariation_status": "unavailable", + "stage2_posterior": 0.9949171617977226, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5395456:5396192-5396289", + "covariation_status": "unavailable", + "stage2_posterior": 4.3274035057265795e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5395456:5396313-5396369", + "covariation_status": "unavailable", + "stage2_posterior": 0.00013853019241736982, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5395968:5396189-5396289", + "covariation_status": "unavailable", + "stage2_posterior": 4.214032770750589e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5691904:5692211-5692299", + "covariation_status": "passed", + "stage2_posterior": 0.05097360445439935, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5691904:5692344-5692492", + "covariation_status": "unavailable", + "stage2_posterior": 0.9976307848003143, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5818368:5819160-5819228", + "covariation_status": "unavailable", + "stage2_posterior": 4.792455467220843e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5818880:5819132-5819228", + "covariation_status": "unavailable", + "stage2_posterior": 9.47226563660434e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:5818880:5819242-5819372", + "covariation_status": "unavailable", + "stage2_posterior": 5.295348681053496e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:6083584:6084219-6084304", + "covariation_status": "failed", + "stage2_posterior": 9.20190924623476e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:6083584:6084322-6084399", + "covariation_status": "unavailable", + "stage2_posterior": 5.9788565318031384e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:6084096:6084219-6084304", + "covariation_status": "failed", + "stage2_posterior": 9.20190924623476e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:6084096:6084322-6084399", + "covariation_status": "unavailable", + "stage2_posterior": 5.9788565318031384e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_002884445.1:c0:861696:862144-862282", + "covariation_status": "unavailable", + "stage2_posterior": 0.999383850913975, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_002884445.1:c0:861696:862318-862398", + "covariation_status": "unavailable", + "stage2_posterior": 6.728610396727682e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_003057965.1:c0:505344:505805-505938", + "covariation_status": "passed", + "stage2_posterior": 0.9952236081332523, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003057965.1:c0:505344:505953-506029", + "covariation_status": "unavailable", + "stage2_posterior": 5.798846252144461e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003574085.1:c109:4608:5361-5454", + "covariation_status": "unavailable", + "stage2_posterior": 1.1119873743574286e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003574085.1:c109:4608:5487-5565", + "covariation_status": "failed", + "stage2_posterior": 9.73402953632036e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003574085.1:c109:5120:5361-5454", + "covariation_status": "unavailable", + "stage2_posterior": 1.1119873743574286e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003574085.1:c109:5120:5487-5565", + "covariation_status": "failed", + "stage2_posterior": 9.73402953632036e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003574085.1:c56:12800:13238-13321", + "covariation_status": "unavailable", + "stage2_posterior": 6.802151870861986e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003574085.1:c56:12800:13335-13391", + "covariation_status": "unavailable", + "stage2_posterior": 5.881627927935983e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003574085.1:c69:3072:3417-3566", + "covariation_status": "unavailable", + "stage2_posterior": 0.9876985121268739, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_003574085.1:c69:3072:3585-3667", + "covariation_status": "unavailable", + "stage2_posterior": 6.747152561677459e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_039822205.1:c2:37888:38190-38323", + "covariation_status": "passed", + "stage2_posterior": 0.16203843643098634, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_039822205.1:c2:37888:38338-38415", + "covariation_status": "passed", + "stage2_posterior": 0.0006071079536912297, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c10:6144:6656-6784", + "covariation_status": "passed", + "stage2_posterior": 0.985707372290681, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c10:6144:6799-6878", + "covariation_status": "failed", + "stage2_posterior": 2.3134316224712955e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c10:6656:6661-6784", + "covariation_status": "failed", + "stage2_posterior": 0.979686610041854, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c10:6656:6799-6878", + "covariation_status": "failed", + "stage2_posterior": 2.3134316224712955e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:205824:206461-206543", + "covariation_status": "unavailable", + "stage2_posterior": 7.903042496598107e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:205824:206560-206644", + "covariation_status": "unavailable", + "stage2_posterior": 1.786309703832072e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:206336:206461-206543", + "covariation_status": "unavailable", + "stage2_posterior": 7.903042496598107e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:206336:206560-206644", + "covariation_status": "unavailable", + "stage2_posterior": 1.786309703832072e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:250368:250816-250900", + "covariation_status": "passed", + "stage2_posterior": 0.004661559259963414, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:250368:250916-251042", + "covariation_status": "unavailable", + "stage2_posterior": 3.0840239660461056e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:250880:250916-251038", + "covariation_status": "unavailable", + "stage2_posterior": 7.362743807582142e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:262144:262595-262685", + "covariation_status": "passed", + "stage2_posterior": 1.968710693361178e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:262144:262701-262856", + "covariation_status": "unavailable", + "stage2_posterior": 0.998565756563166, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:262656:262701-262856", + "covariation_status": "unavailable", + "stage2_posterior": 0.998565756563166, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:312832:313435-313519", + "covariation_status": "passed", + "stage2_posterior": 5.349681489617005e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:312832:313535-313672", + "covariation_status": "unavailable", + "stage2_posterior": 0.9993970996033712, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:313344:313435-313519", + "covariation_status": "passed", + "stage2_posterior": 5.349681489617005e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:313344:313535-313672", + "covariation_status": "unavailable", + "stage2_posterior": 0.9993970996033712, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:33792:34412-34540", + "covariation_status": "unavailable", + "stage2_posterior": 0.2044233584933112, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:33792:34556-34635", + "covariation_status": "failed", + "stage2_posterior": 0.00020903029483141722, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:34304:34412-34540", + "covariation_status": "unavailable", + "stage2_posterior": 0.2044233584933112, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:34304:34555-34635", + "covariation_status": "failed", + "stage2_posterior": 0.000305971665236786, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:358912:359382-359455", + "covariation_status": "passed", + "stage2_posterior": 8.245957138787838e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:358912:359470-359622", + "covariation_status": "unavailable", + "stage2_posterior": 4.57379355807383e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c18:359424:359470-359551", + "covariation_status": "unavailable", + "stage2_posterior": 4.477823690686872e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c19:120832:121403-121532", + "covariation_status": "unavailable", + "stage2_posterior": 0.998962140604069, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c19:120832:121549-121634", + "covariation_status": "unavailable", + "stage2_posterior": 1.865258855846239e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c19:121344:121403-121532", + "covariation_status": "unavailable", + "stage2_posterior": 0.998962140604069, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c19:121344:121549-121634", + "covariation_status": "unavailable", + "stage2_posterior": 1.865258855846239e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c20:129024:129618-129708", + "covariation_status": "passed", + "stage2_posterior": 0.06232778741083055, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c20:129024:129728-129822", + "covariation_status": "unavailable", + "stage2_posterior": 7.787286740341752e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c20:129536:129618-129708", + "covariation_status": "passed", + "stage2_posterior": 0.06270269431060127, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c20:129536:129728-129821", + "covariation_status": "unavailable", + "stage2_posterior": 6.342819744016622e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c21:227328:227718-227802", + "covariation_status": "unavailable", + "stage2_posterior": 2.428455228082361e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c21:227328:227843-227980", + "covariation_status": "unavailable", + "stage2_posterior": 0.9989338554981368, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c21:553984:554863-554927", + "covariation_status": "unavailable", + "stage2_posterior": 4.8320019064614165e-06, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c21:554496:554791-554927", + "covariation_status": "unavailable", + "stage2_posterior": 0.000896599134714468, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c21:554496:554947-555043", + "covariation_status": "failed", + "stage2_posterior": 0.00012631077216024972, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c21:879104:879427-879566", + "covariation_status": "unavailable", + "stage2_posterior": 0.9887378308196371, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c21:879104:879604-879693", + "covariation_status": "unavailable", + "stage2_posterior": 1.045235717867862e-05, + "synteny_status": "failed" + }, + { + "candidate_id": "GCF_041320495.1:c22:218624:219357-219494", + "covariation_status": "unavailable", + "stage2_posterior": 0.994625975060847, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c22:218624:219510-219578", + "covariation_status": "failed", + "stage2_posterior": 0.00014847289943723704, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c22:219136:219357-219494", + "covariation_status": "unavailable", + "stage2_posterior": 0.994625975060847, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c22:219136:219510-219578", + "covariation_status": "failed", + "stage2_posterior": 0.00014847289943723704, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c22:87040:87505-87592", + "covariation_status": "passed", + "stage2_posterior": 2.5491038745227333e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c22:87040:87607-87745", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988330782558764, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c22:87552:87607-87738", + "covariation_status": "unavailable", + "stage2_posterior": 0.9985639394881783, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c3:31232:31622-31696", + "covariation_status": "unavailable", + "stage2_posterior": 1.4363158241062863e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c3:31232:31725-31882", + "covariation_status": "unavailable", + "stage2_posterior": 0.9993315548464102, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c3:53760:54229-54307", + "covariation_status": "unavailable", + "stage2_posterior": 8.861477042484449e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c3:53760:54323-54460", + "covariation_status": "unavailable", + "stage2_posterior": 0.9887960889472542, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c3:54272:54323-54460", + "covariation_status": "unavailable", + "stage2_posterior": 0.9887960889472542, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c5:25088:25745-25866", + "covariation_status": "passed", + "stage2_posterior": 0.9791645431362702, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c5:25088:25882-25955", + "covariation_status": "failed", + "stage2_posterior": 0.0005943638801800522, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c5:25600:25745-25866", + "covariation_status": "passed", + "stage2_posterior": 0.9791645431362702, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c5:25600:25882-25955", + "covariation_status": "failed", + "stage2_posterior": 0.0005943638801800522, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c5:58880:59629-59750", + "covariation_status": "unavailable", + "stage2_posterior": 0.16876822653797843, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c5:58880:59763-59837", + "covariation_status": "unavailable", + "stage2_posterior": 1.4621359333308135e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c5:59392:59629-59837", + "covariation_status": "unavailable", + "stage2_posterior": 0.989569547961435, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c6:76800:77309-77392", + "covariation_status": "unavailable", + "stage2_posterior": 6.6389395883462545e-06, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c6:76800:77426-77564", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988030100516855, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c6:77312:77426-77564", + "covariation_status": "unavailable", + "stage2_posterior": 0.9988030100516855, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c7:6144:6554-6640", + "covariation_status": "unavailable", + "stage2_posterior": 2.0597573518802968e-05, + "synteny_status": "passed" + }, + { + "candidate_id": "GCF_041320495.1:c7:6144:6655-6794", + "covariation_status": "unavailable", + "stage2_posterior": 0.9972693271245384, + "synteny_status": "failed" + } + ], + "schema_version": "1.0", + "sources": { + "covariation_status": { + "anchored_by": "reports/p3/architecture_parameter_measurement.json records this exact digest (verified on write)", + "origin": "two.amlab:$HOME/tbox-scratch/round_p3_15_supply/covariation_status.json", + "produced_by": "P3-15'-e / -e-ii (SLURM jobs 1205 + 1254)", + "sha256": "3215f0340b9b85bc49a862b66ecc1b7367485d22650277a83894e2e1ef3d8167" + }, + "stage2_posteriors": { + "anchored_by": null, + "origin": "two.amlab:$HOME/tbox-scratch/round_p3_15b/stage2_posteriors.json", + "produced_by": "P3-15'-b", + "sha256": "54be6e6d0297558f7357d24a10940562c3691036f6e36435b3e6524be498adf8", + "warning": "\u26a0 NO committed report records this digest, and a second scoring of the same 941 candidates exists whose posteriors differ by up to 3.8e-2 (a CUDA forward is not bit-reproducible). The two agree on every candidate at thresholds 0.5 / 0.9 / 0.95 and disagree on 3 at 0.99. This column is therefore carried as a SENSITIVITY only; no headline number rests on it." + }, + "synteny_status": { + "anchored_by": "reports/p3/synteny_exclusion_diagnostic.json records this exact digest (verified on write)", + "origin": "LOCAL \u2014 tbox_finder.mining.synteny_producer (P3-15'-c-ii)", + "produced_by": "P3-15'-c-ii", + "sha256": "3c8ac8e31b9e7cde6dee50328ca3efa7ac798b54def17885f92c930b8b04a464" + } + }, + "step": "P3-15'-f" +} diff --git a/reports/p3/architecture_parameter_recommendation.json b/reports/p3/architecture_parameter_recommendation.json new file mode 100644 index 00000000..20f43650 --- /dev/null +++ b/reports/p3/architecture_parameter_recommendation.json @@ -0,0 +1,1475 @@ +{ + "adr": "ADR-0006 D3 (criterion (b)'s named-element predicate), D6 (the short-Stem-I relaxation), A4 (the seven rule parameters supplied per round, no defaults); ADR-0005 D14 (the spare rule: sparing is a disjunction, so mining is a conjunction; unavailable spares); ADR-0004 D1 (the element vocabulary D3 reuses)", + "arms": { + "comparison_headline_carried_forward": "criterion (b)'s failure share on KNOWN T-boxes, as the de-novo instrument resolves them, is read against its failure share on round-0 FP-manifest candidates at the identical grid. Where the control's record-level interval contains the FP arm's point estimate, this control detects no separation between the two populations at that setting \u2014 (b) behaves there as a severity knob on both arms rather than as a discriminator.", + "control": { + "ground_truth": "believed positive \u2014 held-out curated TBDB records, Stage-1 re-detected", + "n_consensuses": 76, + "step": "P3-15'-g-iv", + "supply_digest_sha256": "0b5afbec0c8fd9af75a5c789d44f64e0b8db1c19ecce011eac6dd92e3393cb28", + "supply_origin": "two.amlab:$HOME/tbox-scratch/round_p3_15g_control/msa (SLURM job 1264 array 0-15, main @ c94f935); retrieved by rsync per slurm/p2/mine_round_producer.sbatch" + }, + "fp": { + "ground_truth": "unknown \u2014 a round-0 false-positive MANIFEST, not verified negatives", + "n_consensuses": 278, + "step": "P3-15'-f", + "supply_digest_sha256": "90b2fe1b532f2851bbade2884e8498e2ab58a11c418cc00b314840f041c0f862", + "supply_origin": "two.amlab:$HOME/tbox-scratch/round_p3_15_supply/msa (SLURM jobs 1205 array 0-47 + 1254 array 16-16, main @ 4d30ea3); retrieved by rsync per slurm/p2/mine_round_producer.sbatch" + } + }, + "decision_rule": { + "floors": [ + { + "floor": "min_named_helices >= 2", + "rationale": "\u26a0 THIS FLOOR'S LEVEL IS A \u00a77 READING, NOT A DERIVATION, AND IT DECIDES THE HEADLINE. D3 says 'the expected helices are present' and assigns the value to the held-out canonical set at P6; it contains no number. Two readings are supported: PLURAL (>= 2, this floor) and CANONICAL CORE (>= 3, which architecture.named_elements_present's own docstring states). recommendation.selection_by_min_named_helices prices every level, and the level is put to the project lead rather than settled here. The floor is set at 2 only because a sparing disjunct's fail-closed direction is the more permissive one (ADR-0006 A4). \u26a0 Note also that min_named_helices counts RESOLVED helices of sufficient stacking depth, not identified D1 elements \u2014 the localizer has no element identity to check \u2014 so 'the expected helices are present' is operationalised as a count throughout.", + "source": "ADR-0006 D3 (no number; P6-delegated) + A4; the competing reading is in src/tbox_finder/mining/architecture.py::named_elements_present" + }, + { + "floor": "min_helix_pairs >= 2", + "rationale": "min_helix_pairs is the number of stacked pairs at which a run of pairing counts as a helix at all. At 1 a single isolated base pair is a named structural element. \u26a0 ADR-0006 D3 contains NO concept of stacked-pair depth, so this floor is an ASSUMPTION about what the word 'helix' may denote, not a reading of the ADR; it is listed here so it can be rejected. Its empirical side is published beside it in helix_stack_depth_evidence, and on this supply the settings it excludes measure identically to the chosen one, so it costs nothing measurable either way.", + "source": "an ASSUMPTION of this module, not an ADR clause \u2014 see the rationale" + }, + { + "floor": "ncca_pairing_nt >= 2", + "rationale": "D3 requires an 'NCCA-PAIRING bulge'. One satisfied contact in the acceptor register is a coincidence at these alignment widths, not a register; two is the weakest reading under which the word 'pairing' is doing work.", + "source": "ADR-0006 D3" + }, + { + "floor": "bulge_max_nt is bounded", + "rationale": "bulge_max_nt = 10000 is the axis's no-upper-bound sentinel: the size filter stops filtering and bulge_min_nt alone decides. A round may choose that, but it may not then describe (b) as testing a bulge SIZE. \u26a0 This floor is semantic, not decisive, and the claim that it costs nothing is measured rather than argued: see recommendation.bulge_sentinel_comparison, which puts the chosen setting against its own sentinel twin. It is NOT readable off floor_sensitivity, whose identity field is null here precisely because dropping this floor does not move the selection.", + "source": "ADR-0006 D3; ADR-0006 A4 (the value is recorded and must mean what it says)" + } + ], + "statement": "Stated before any count was read. (1) Keep only points the SHIPPED localizer accepts on this supply \u2014 admissibility is measured by running it, not by re-encoding its guards. (2) Keep only points that clear every DECISION_FLOORS entry, each of which is a semantic requirement read off ADR-0006 D3's wording, not a tuned threshold. (3) Among the survivors choose the MOST PERMISSIVE as measured \u2014 the smallest number of FP-arm consensuses moved to 'failed'. Permissiveness is the fail-closed direction for a SPARING disjunct, and ADR-0006 A4 makes that argument itself: a relaxation 'only ever makes (b) more likely to pass => more sparing => the fail-closed direction, so an imperfect value errs safe'. (4) Break exact ties by TIE_BREAK_ORDER, and REFUSE if a tie survives among parameters not proved inert. \u26a0 What this rule deliberately does NOT do is maximise yield over the grid: with thousands of admissible points and a control of a few dozen producible records, the argmax is a fitted value, and A4 asks the round to supply a chosen one. Every count lives in the derived blocks (grid.n_admissible, control_arm.n_records_producible), never in this sentence, so the prose cannot go stale against its own run.", + "tie_break_order": [ + { + "parameter": "allow_wobble", + "resolves_to": "False \u2014 the flag is proved structurally inert for the NCCA acceptor, so recording it as enabled would publish a relaxation that cannot fire" + }, + { + "parameter": "stem_i_nt_threshold", + "resolves_to": "the smallest value on the axis \u2014 the D6 relaxation is proved inert on this manifest (neither stem_i_extent_nt nor regulatory_mode is supplied), and the smallest value is the one under which it demonstrably never fires" + }, + { + "parameter": "bulge_max_nt", + "resolves_to": "the smallest bounded value among exact ties \u2014 a narrower stated filter, given the wider one measured identically" + } + ] + }, + "disclosure": "This report RECOMMENDS criterion (b)'s seven ADR-0006 A4 rule parameters and pins none of them. The value is a CLAUDE.md \u00a77 decision for the project lead; it enters the round through the producer's seven required exports and is recorded in that round's provenance, per A4. D6/D17's P6 threshold freeze is untouched, and no ADR is amended by this step.", + "frontier_all_admissible": [ + { + "ci95": [ + 0.050765, + 0.197581 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 1, + "min_helix_pairs": 1, + "min_named_helices": 1, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 7, + "n_admissible_points_at_this_yield": 96, + "n_mined": 1, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.050765, + 0.197581 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 1, + "min_helix_pairs": 3, + "min_named_helices": 2, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 7, + "n_admissible_points_at_this_yield": 16, + "n_mined": 2, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.060834, + 0.215351 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 2, + "min_helix_pairs": 1, + "min_named_helices": 1, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 8, + "n_admissible_points_at_this_yield": 48, + "n_mined": 3, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.050765, + 0.197581 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 1, + "min_helix_pairs": 5, + "min_named_helices": 1, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 7, + "n_admissible_points_at_this_yield": 456, + "n_mined": 4, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.060834, + 0.215351 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 3, + "min_helix_pairs": 3, + "min_named_helices": 2, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 8, + "n_admissible_points_at_this_yield": 72, + "n_mined": 5, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.060834, + 0.215351 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 2, + "min_helix_pairs": 5, + "min_named_helices": 1, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 8, + "n_admissible_points_at_this_yield": 80, + "n_mined": 6, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.115272, + 0.300109 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 7, + "min_helix_pairs": 1, + "min_named_helices": 1, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 13, + "n_admissible_points_at_this_yield": 168, + "n_mined": 7, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.115272, + 0.300109 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 7, + "min_helix_pairs": 5, + "min_named_helices": 1, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 13, + "n_admissible_points_at_this_yield": 88, + "n_mined": 9, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.276093, + 0.501195 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 10, + "bulge_min_nt": 1, + "min_helix_pairs": 3, + "min_named_helices": 3, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 26, + "n_admissible_points_at_this_yield": 16, + "n_mined": 10, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.250018, + 0.471592 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 2, + "min_helix_pairs": 4, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 24, + "n_admissible_points_at_this_yield": 672, + "n_mined": 11, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.289285, + 0.515842 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 10, + "bulge_min_nt": 2, + "min_helix_pairs": 3, + "min_named_helices": 3, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 27, + "n_admissible_points_at_this_yield": 120, + "n_mined": 12, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.343047, + 0.573436 + ], + "clears_every_decision_floor": false, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 10, + "bulge_min_nt": 2, + "min_helix_pairs": 1, + "min_named_helices": 4, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 31, + "n_admissible_points_at_this_yield": 1048, + "n_mined": 13, + "of_n_producible_records": 68 + } + ], + "frontier_clearing_every_floor": [ + { + "ci95": [ + 0.060834, + 0.215351 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 8, + "n_admissible_points_at_this_yield": 6, + "n_mined": 3, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.060834, + 0.215351 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 2, + "min_helix_pairs": 3, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 8, + "n_admissible_points_at_this_yield": 42, + "n_mined": 4, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.060834, + 0.215351 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 3, + "min_helix_pairs": 3, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 8, + "n_admissible_points_at_this_yield": 36, + "n_mined": 5, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.115272, + 0.300109 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 7, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 13, + "n_admissible_points_at_this_yield": 24, + "n_mined": 7, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.250018, + 0.471592 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 2, + "min_helix_pairs": 4, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 24, + "n_admissible_points_at_this_yield": 198, + "n_mined": 11, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.289285, + 0.515842 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 10, + "bulge_min_nt": 2, + "min_helix_pairs": 3, + "min_named_helices": 3, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 27, + "n_admissible_points_at_this_yield": 54, + "n_mined": 12, + "of_n_producible_records": 68 + }, + { + "ci95": [ + 0.343047, + 0.573436 + ], + "clears_every_decision_floor": true, + "example_params": { + "allow_wobble": false, + "bulge_max_nt": 10, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 4, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "fewest_control_records_losing_a_and_b": 31, + "n_admissible_points_at_this_yield": 504, + "n_mined": 13, + "of_n_producible_records": 68 + } + ], + "grid": { + "axes": { + "allow_wobble": [ + false, + true + ], + "bulge_max_nt": [ + 10, + 20, + 50, + 10000 + ], + "bulge_min_nt": [ + 1, + 2, + 3, + 4, + 5, + 7 + ], + "min_helix_pairs": [ + 1, + 2, + 3, + 4, + 5 + ], + "min_named_helices": [ + 1, + 2, + 3, + 4 + ], + "ncca_pairing_nt": [ + 1, + 2, + 3, + 4 + ] + }, + "n_admissible": 2880, + "n_points_enumerated": 3840, + "n_refused_by_the_shipped_localizer": 960, + "note": "admissibility is MEASURED by running the shipped localizer, not by re-encoding its guards: it refuses any setting whose bulge size floor is shorter than its NCCA register.", + "refusal_reasons": { + "bulge_size_range min 1 is shorter than ncca_pairing_nt 2": 160, + "bulge_size_range min 1 is shorter than ncca_pairing_nt 3": 160, + "bulge_size_range min 1 is shorter than ncca_pairing_nt 4": 160, + "bulge_size_range min 2 is shorter than ncca_pairing_nt 3": 160, + "bulge_size_range min 2 is shorter than ncca_pairing_nt 4": 160, + "bulge_size_range min 3 is shorter than ncca_pairing_nt 4": 160 + } + }, + "limitations": { + "criterion_c_is_unmeasured_on_the_control": "the control's hosts carry no annotation, so every control damage figure omits the one criterion with measured discrimination and is an upper bound.", + "stage2_threshold_is_unpinned": "ADR-0005 D3/D14 freeze the Stage-2 threshold at the \u00a713.1 phase gate; none is pinned here. 'stage2_not_declared' is the P2 accounting (the disjunct is not in play) and is an UPPER bound: declaring Stage-2 at any threshold can only spare more.", + "the_control_is_68_records": "adjacent grid points differing by a few candidates are not distinguishable at this n; the frontier is reported as what the grid contains, not as a ranking.", + "the_fp_arm_is_not_a_verified_negative_set": "it is a false-positive MANIFEST of unknown status. If a material share of it is really T-box, the two arms are not two populations and the anti-selectivity reading weakens accordingly.", + "the_grid_is_not_the_parameter_space": "the axes are the two measurement reports' sweep; a value off those axes is unmeasured here, and stem_i_nt_threshold is swept at one value because it is proved inert on both manifests." + }, + "named_settings": [ + { + "anti_selectivity": { + "also_at_the_row_level_for_reference": { + "control_queries_failing_a_and_b": "7/76", + "fp_candidates_failing_a_and_b": "20/278", + "no_interval_because": "neither row unit is independent \u2014 control queries share records and FP candidates share loci \u2014 so these are point counts only" + }, + "control_ci95": [ + 0.050765, + 0.197581 + ], + "control_falls_through_more": true, + "control_records_failing_a_and_b": "7/68", + "control_share": 0.102941, + "fp_ci95": [ + 0.046208, + 0.120629 + ], + "fp_loci_failing_a_and_b": "15/199", + "fp_minus_control_pp": -2.7564, + "fp_share": 0.075377, + "intervals_disjoint": false, + "unit": "control = producible RECORDS; FP arm = decided LOCI", + "what_disjointness_would_and_would_not_mean": "non-overlapping Wilson intervals are a CONSERVATIVE indication of a difference, not a test of one; overlapping intervals do not establish equality either. Read the direction and the size, not the flag." + }, + "clears_every_decision_floor": false, + "control_arm": { + "criterion_c_not_in_this_conjunction": "the control's host genomes carry no GFF annotation, so criterion (c) is UNMEASURED on this arm and is absent from the conjunction. Real T-boxes are the population (c) is most likely to spare, so this damage figure is an UPPER bound; the FP arm's yield, by contrast, does include (c).", + "n_queries_a_and_b_failed": 7, + "n_queries_b_failed": 8, + "n_queries_decided": 76, + "n_records_losing_a_and_b": 7, + "n_records_losing_b": 7, + "n_records_producible": 68, + "query_level_ci95": null, + "share_records_losing_a_and_b": 0.102941, + "share_records_losing_a_and_b_ci95": [ + 0.050765, + 0.197581 + ], + "share_records_losing_b": 0.102941, + "share_records_losing_b_ci95": [ + 0.050765, + 0.197581 + ], + "why_no_query_ci": "the control's queries are pseudo-replicated \u2014 most records contribute more than one \u2014 so a binomial interval on them would be narrower than the data support. Every interval here is on the record level." + }, + "floors_cleared": [ + "min_helix_pairs >= 2" + ], + "fp_arm": { + "failed": 25, + "failed_with_criterion_a_failed": 20, + "loci_decided": 199, + "loci_failing_a_and_b": 15, + "passed": 253, + "share_failed_of_decided": 0.089928, + "unit_note": "the candidate counts are manifest rows; the LOCUS counts collapse candidates addressing the same span from overlapping tiling windows. Every FP interval in this report is on the locus." + }, + "label": "loosest_nonvacuous", + "params": { + "allow_wobble": false, + "bulge_max_nt": 10000, + "bulge_min_nt": 1, + "min_helix_pairs": 2, + "min_named_helices": 1, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + }, + "round_yield_n_mined": { + "stage2_not_declared": 1, + "stage2_threshold_0.5": 1, + "stage2_threshold_0.9": 1, + "stage2_threshold_0.95": 1, + "stage2_threshold_0.99": 1 + }, + "round_yield_n_mined_loci": { + "stage2_not_declared": 1, + "stage2_threshold_0.5": 1, + "stage2_threshold_0.9": 1, + "stage2_threshold_0.95": 1, + "stage2_threshold_0.99": 1 + } + }, + { + "anti_selectivity": { + "also_at_the_row_level_for_reference": { + "control_queries_failing_a_and_b": "8/76", + "fp_candidates_failing_a_and_b": "32/278", + "no_interval_because": "neither row unit is independent \u2014 control queries share records and FP candidates share loci \u2014 so these are point counts only" + }, + "control_ci95": [ + 0.060834, + 0.215351 + ], + "control_falls_through_more": false, + "control_records_failing_a_and_b": "8/68", + "control_share": 0.117647, + "fp_ci95": [ + 0.08656, + 0.178877 + ], + "fp_loci_failing_a_and_b": "25/199", + "fp_minus_control_pp": 0.7981, + "fp_share": 0.125628, + "intervals_disjoint": false, + "unit": "control = producible RECORDS; FP arm = decided LOCI", + "what_disjointness_would_and_would_not_mean": "non-overlapping Wilson intervals are a CONSERVATIVE indication of a difference, not a test of one; overlapping intervals do not establish equality either. Read the direction and the size, not the flag." + }, + "clears_every_decision_floor": true, + "control_arm": { + "criterion_c_not_in_this_conjunction": "the control's host genomes carry no GFF annotation, so criterion (c) is UNMEASURED on this arm and is absent from the conjunction. Real T-boxes are the population (c) is most likely to spare, so this damage figure is an UPPER bound; the FP arm's yield, by contrast, does include (c).", + "n_queries_a_and_b_failed": 8, + "n_queries_b_failed": 11, + "n_queries_decided": 76, + "n_records_losing_a_and_b": 8, + "n_records_losing_b": 9, + "n_records_producible": 68, + "query_level_ci95": null, + "share_records_losing_a_and_b": 0.117647, + "share_records_losing_a_and_b_ci95": [ + 0.060834, + 0.215351 + ], + "share_records_losing_b": 0.132353, + "share_records_losing_b_ci95": [ + 0.071222, + 0.232803 + ], + "why_no_query_ci": "the control's queries are pseudo-replicated \u2014 most records contribute more than one \u2014 so a binomial interval on them would be narrower than the data support. Every interval here is on the record level." + }, + "floors_cleared": [ + "min_named_helices >= 2", + "min_helix_pairs >= 2", + "ncca_pairing_nt >= 2", + "bulge_max_nt is bounded" + ], + "fp_arm": { + "failed": 52, + "failed_with_criterion_a_failed": 32, + "loci_decided": 199, + "loci_failing_a_and_b": 25, + "passed": 226, + "share_failed_of_decided": 0.18705, + "unit_note": "the candidate counts are manifest rows; the LOCUS counts collapse candidates addressing the same span from overlapping tiling windows. Every FP interval in this report is on the locus." + }, + "label": "sensitive_core", + "params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "round_yield_n_mined": { + "stage2_not_declared": 3, + "stage2_threshold_0.5": 3, + "stage2_threshold_0.9": 3, + "stage2_threshold_0.95": 3, + "stage2_threshold_0.99": 3 + }, + "round_yield_n_mined_loci": { + "stage2_not_declared": 3, + "stage2_threshold_0.5": 3, + "stage2_threshold_0.9": 3, + "stage2_threshold_0.95": 3, + "stage2_threshold_0.99": 3 + } + }, + { + "anti_selectivity": { + "also_at_the_row_level_for_reference": { + "control_queries_failing_a_and_b": "29/76", + "fp_candidates_failing_a_and_b": "66/278", + "no_interval_because": "neither row unit is independent \u2014 control queries share records and FP candidates share loci \u2014 so these are point counts only" + }, + "control_ci95": [ + 0.276093, + 0.501195 + ], + "control_falls_through_more": true, + "control_records_failing_a_and_b": "26/68", + "control_share": 0.382353, + "fp_ci95": [ + 0.187028, + 0.305186 + ], + "fp_loci_failing_a_and_b": "48/199", + "fp_minus_control_pp": -14.1147, + "fp_share": 0.241206, + "intervals_disjoint": false, + "unit": "control = producible RECORDS; FP arm = decided LOCI", + "what_disjointness_would_and_would_not_mean": "non-overlapping Wilson intervals are a CONSERVATIVE indication of a difference, not a test of one; overlapping intervals do not establish equality either. Read the direction and the size, not the flag." + }, + "clears_every_decision_floor": true, + "control_arm": { + "criterion_c_not_in_this_conjunction": "the control's host genomes carry no GFF annotation, so criterion (c) is UNMEASURED on this arm and is absent from the conjunction. Real T-boxes are the population (c) is most likely to spare, so this damage figure is an UPPER bound; the FP arm's yield, by contrast, does include (c).", + "n_queries_a_and_b_failed": 29, + "n_queries_b_failed": 39, + "n_queries_decided": 76, + "n_records_losing_a_and_b": 26, + "n_records_losing_b": 33, + "n_records_producible": 68, + "query_level_ci95": null, + "share_records_losing_a_and_b": 0.382353, + "share_records_losing_a_and_b_ci95": [ + 0.276093, + 0.501195 + ], + "share_records_losing_b": 0.485294, + "share_records_losing_b_ci95": [ + 0.370506, + 0.601655 + ], + "why_no_query_ci": "the control's queries are pseudo-replicated \u2014 most records contribute more than one \u2014 so a binomial interval on them would be narrower than the data support. Every interval here is on the record level." + }, + "floors_cleared": [ + "min_named_helices >= 2", + "min_helix_pairs >= 2", + "ncca_pairing_nt >= 2", + "bulge_max_nt is bounded" + ], + "fp_arm": { + "failed": 141, + "failed_with_criterion_a_failed": 66, + "loci_decided": 199, + "loci_failing_a_and_b": 48, + "passed": 137, + "share_failed_of_decided": 0.507194, + "unit_note": "the candidate counts are manifest rows; the LOCUS counts collapse candidates addressing the same span from overlapping tiling windows. Every FP interval in this report is on the locus." + }, + "label": "canonical_core_3helix", + "params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 4, + "min_helix_pairs": 2, + "min_named_helices": 3, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "round_yield_n_mined": { + "stage2_not_declared": 11, + "stage2_threshold_0.5": 11, + "stage2_threshold_0.9": 11, + "stage2_threshold_0.95": 11, + "stage2_threshold_0.99": 11 + }, + "round_yield_n_mined_loci": { + "stage2_not_declared": 9, + "stage2_threshold_0.5": 9, + "stage2_threshold_0.9": 9, + "stage2_threshold_0.95": 9, + "stage2_threshold_0.99": 9 + } + }, + { + "anti_selectivity": { + "also_at_the_row_level_for_reference": { + "control_queries_failing_a_and_b": "33/76", + "fp_candidates_failing_a_and_b": "89/278", + "no_interval_because": "neither row unit is independent \u2014 control queries share records and FP candidates share loci \u2014 so these are point counts only" + }, + "control_ci95": [ + 0.315971, + 0.544834 + ], + "control_falls_through_more": true, + "control_records_failing_a_and_b": "29/68", + "control_share": 0.426471, + "fp_ci95": [ + 0.260617, + 0.389356 + ], + "fp_loci_failing_a_and_b": "64/199", + "fp_minus_control_pp": -10.4863, + "fp_share": 0.321608, + "intervals_disjoint": false, + "unit": "control = producible RECORDS; FP arm = decided LOCI", + "what_disjointness_would_and_would_not_mean": "non-overlapping Wilson intervals are a CONSERVATIVE indication of a difference, not a test of one; overlapping intervals do not establish equality either. Read the direction and the size, not the flag." + }, + "clears_every_decision_floor": true, + "control_arm": { + "criterion_c_not_in_this_conjunction": "the control's host genomes carry no GFF annotation, so criterion (c) is UNMEASURED on this arm and is absent from the conjunction. Real T-boxes are the population (c) is most likely to spare, so this damage figure is an UPPER bound; the FP arm's yield, by contrast, does include (c).", + "n_queries_a_and_b_failed": 33, + "n_queries_b_failed": 49, + "n_queries_decided": 76, + "n_records_losing_a_and_b": 29, + "n_records_losing_b": 41, + "n_records_producible": 68, + "query_level_ci95": null, + "share_records_losing_a_and_b": 0.426471, + "share_records_losing_a_and_b_ci95": [ + 0.315971, + 0.544834 + ], + "share_records_losing_b": 0.602941, + "share_records_losing_b_ci95": [ + 0.484158, + 0.710715 + ], + "why_no_query_ci": "the control's queries are pseudo-replicated \u2014 most records contribute more than one \u2014 so a binomial interval on them would be narrower than the data support. Every interval here is on the record level." + }, + "floors_cleared": [ + "min_named_helices >= 2", + "min_helix_pairs >= 2", + "ncca_pairing_nt >= 2", + "bulge_max_nt is bounded" + ], + "fp_arm": { + "failed": 220, + "failed_with_criterion_a_failed": 89, + "loci_decided": 199, + "loci_failing_a_and_b": 64, + "passed": 58, + "share_failed_of_decided": 0.791367, + "unit_note": "the candidate counts are manifest rows; the LOCUS counts collapse candidates addressing the same span from overlapping tiling windows. Every FP interval in this report is on the locus." + }, + "label": "canonical_core_3helix_ncca3", + "params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 4, + "min_helix_pairs": 2, + "min_named_helices": 3, + "ncca_pairing_nt": 3, + "stem_i_nt_threshold": 1 + }, + "round_yield_n_mined": { + "stage2_not_declared": 11, + "stage2_threshold_0.5": 11, + "stage2_threshold_0.9": 11, + "stage2_threshold_0.95": 11, + "stage2_threshold_0.99": 11 + }, + "round_yield_n_mined_loci": { + "stage2_not_declared": 9, + "stage2_threshold_0.5": 9, + "stage2_threshold_0.9": 9, + "stage2_threshold_0.95": 9, + "stage2_threshold_0.99": 9 + } + }, + { + "anti_selectivity": { + "also_at_the_row_level_for_reference": { + "control_queries_failing_a_and_b": "44/76", + "fp_candidates_failing_a_and_b": "104/278", + "no_interval_because": "neither row unit is independent \u2014 control queries share records and FP candidates share loci \u2014 so these are point counts only" + }, + "control_ci95": [ + 0.440817, + 0.67054 + ], + "control_falls_through_more": true, + "control_records_failing_a_and_b": "38/68", + "control_share": 0.558824, + "fp_ci95": [ + 0.312485, + 0.445948 + ], + "fp_loci_failing_a_and_b": "75/199", + "fp_minus_control_pp": -18.1939, + "fp_share": 0.376884, + "intervals_disjoint": false, + "unit": "control = producible RECORDS; FP arm = decided LOCI", + "what_disjointness_would_and_would_not_mean": "non-overlapping Wilson intervals are a CONSERVATIVE indication of a difference, not a test of one; overlapping intervals do not establish equality either. Read the direction and the size, not the flag." + }, + "clears_every_decision_floor": true, + "control_arm": { + "criterion_c_not_in_this_conjunction": "the control's host genomes carry no GFF annotation, so criterion (c) is UNMEASURED on this arm and is absent from the conjunction. Real T-boxes are the population (c) is most likely to spare, so this damage figure is an UPPER bound; the FP arm's yield, by contrast, does include (c).", + "n_queries_a_and_b_failed": 44, + "n_queries_b_failed": 72, + "n_queries_decided": 76, + "n_records_losing_a_and_b": 38, + "n_records_losing_b": 64, + "n_records_producible": 68, + "query_level_ci95": null, + "share_records_losing_a_and_b": 0.558824, + "share_records_losing_a_and_b_ci95": [ + 0.440817, + 0.67054 + ], + "share_records_losing_b": 0.941176, + "share_records_losing_b_ci95": [ + 0.858281, + 0.97689 + ], + "why_no_query_ci": "the control's queries are pseudo-replicated \u2014 most records contribute more than one \u2014 so a binomial interval on them would be narrower than the data support. Every interval here is on the record level." + }, + "floors_cleared": [ + "min_named_helices >= 2", + "min_helix_pairs >= 2", + "ncca_pairing_nt >= 2", + "bulge_max_nt is bounded" + ], + "fp_arm": { + "failed": 265, + "failed_with_criterion_a_failed": 104, + "loci_decided": 199, + "loci_failing_a_and_b": 75, + "passed": 13, + "share_failed_of_decided": 0.953237, + "unit_note": "the candidate counts are manifest rows; the LOCUS counts collapse candidates addressing the same span from overlapping tiling windows. Every FP interval in this report is on the locus." + }, + "label": "curated_freeze_transplant", + "params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 4, + "min_helix_pairs": 3, + "min_named_helices": 4, + "ncca_pairing_nt": 4, + "stem_i_nt_threshold": 1 + }, + "round_yield_n_mined": { + "stage2_not_declared": 13, + "stage2_threshold_0.5": 12, + "stage2_threshold_0.9": 13, + "stage2_threshold_0.95": 13, + "stage2_threshold_0.99": 13 + }, + "round_yield_n_mined_loci": { + "stage2_not_declared": 11, + "stage2_threshold_0.5": 10, + "stage2_threshold_0.9": 11, + "stage2_threshold_0.95": 11, + "stage2_threshold_0.99": 11 + } + }, + { + "anti_selectivity": { + "also_at_the_row_level_for_reference": { + "control_queries_failing_a_and_b": "45/76", + "fp_candidates_failing_a_and_b": "107/278", + "no_interval_because": "neither row unit is independent \u2014 control queries share records and FP candidates share loci \u2014 so these are point counts only" + }, + "control_ci95": [ + 0.440817, + 0.67054 + ], + "control_falls_through_more": true, + "control_records_failing_a_and_b": "38/68", + "control_share": 0.558824, + "fp_ci95": [ + 0.326791, + 0.461221 + ], + "fp_loci_failing_a_and_b": "78/199", + "fp_minus_control_pp": -16.6864, + "fp_share": 0.39196, + "intervals_disjoint": false, + "unit": "control = producible RECORDS; FP arm = decided LOCI", + "what_disjointness_would_and_would_not_mean": "non-overlapping Wilson intervals are a CONSERVATIVE indication of a difference, not a test of one; overlapping intervals do not establish equality either. Read the direction and the size, not the flag." + }, + "clears_every_decision_floor": true, + "control_arm": { + "criterion_c_not_in_this_conjunction": "the control's host genomes carry no GFF annotation, so criterion (c) is UNMEASURED on this arm and is absent from the conjunction. Real T-boxes are the population (c) is most likely to spare, so this damage figure is an UPPER bound; the FP arm's yield, by contrast, does include (c).", + "n_queries_a_and_b_failed": 45, + "n_queries_b_failed": 75, + "n_queries_decided": 76, + "n_records_losing_a_and_b": 38, + "n_records_losing_b": 67, + "n_records_producible": 68, + "query_level_ci95": null, + "share_records_losing_a_and_b": 0.558824, + "share_records_losing_a_and_b_ci95": [ + 0.440817, + 0.67054 + ], + "share_records_losing_b": 0.985294, + "share_records_losing_b_ci95": [ + 0.921288, + 0.997399 + ], + "why_no_query_ci": "the control's queries are pseudo-replicated \u2014 most records contribute more than one \u2014 so a binomial interval on them would be narrower than the data support. Every interval here is on the record level." + }, + "floors_cleared": [ + "min_named_helices >= 2", + "min_helix_pairs >= 2", + "ncca_pairing_nt >= 2", + "bulge_max_nt is bounded" + ], + "fp_arm": { + "failed": 271, + "failed_with_criterion_a_failed": 107, + "loci_decided": 199, + "loci_failing_a_and_b": 78, + "passed": 7, + "share_failed_of_decided": 0.97482, + "unit_note": "the candidate counts are manifest rows; the LOCUS counts collapse candidates addressing the same span from overlapping tiling windows. Every FP interval in this report is on the locus." + }, + "label": "strictest", + "params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 7, + "min_helix_pairs": 5, + "min_named_helices": 4, + "ncca_pairing_nt": 4, + "stem_i_nt_threshold": 1 + }, + "round_yield_n_mined": { + "stage2_not_declared": 13, + "stage2_threshold_0.5": 12, + "stage2_threshold_0.9": 13, + "stage2_threshold_0.95": 13, + "stage2_threshold_0.99": 13 + }, + "round_yield_n_mined_loci": { + "stage2_not_declared": 11, + "stage2_threshold_0.5": 10, + "stage2_threshold_0.9": 11, + "stage2_threshold_0.95": 11, + "stage2_threshold_0.99": 11 + } + } + ], + "pins_nothing": true, + "provenance": { + "adr": "ADR-0006 D3 (criterion (b)'s named-element predicate), D6 (the short-Stem-I relaxation), A4 (the seven rule parameters supplied per round, no defaults); ADR-0005 D14 (the spare rule: sparing is a disjunction, so mining is a conjunction; unavailable spares); ADR-0004 D1 (the element vocabulary D3 reuses)", + "env_lock_hash": null, + "extra": { + "external_inputs": { + "control_msa_root": "msa_supply_control", + "control_supply_digest_sha256": "0b5afbec0c8fd9af75a5c789d44f64e0b8db1c19ecce011eac6dd92e3393cb28", + "fp_msa_root": "msa_supply", + "fp_supply_digest_sha256": "90b2fe1b532f2851bbade2884e8498e2ab58a11c418cc00b314840f041c0f862", + "supply_origin": "two.amlab:$HOME/tbox-scratch/round_p3_15_supply/msa (jobs 1205+1254) and round_p3_15g_control/msa (job 1264); retrieved by rsync" + }, + "schema_version": "1.0" + }, + "generated_at_utc": "2026-08-12T19:00:12.067100+00:00", + "git_sha": "9bf7e70eb1d8d270a21ca0bace0c5cdd30aec2d1", + "inputs": { + "data/processed/mining/curated_control_manifest_v0.json": "363795fba6cd4d1d85495ec62e6e62cd11f1bf37b0fdf739c48315777c4d2a83", + "data/processed/mining/curated_control_status_v0.json": "8b5e8f4178cd63eb8664c1e63e519c5810223eb56ca3a1488ce8bfee9dbeb033", + "data/processed/mining/round0_fp_manifest.json": "e8aff87d395b3cb70a25c1f1d4ac348daf3da9323baa4c04a32fd3e4060d4b95", + "data/processed/mining/round0_fp_spare_rule_inputs_v0.json": "65aedc885d96a4266ff02877a9f9ee02313c9f6c8e90013481675f43a59fca35", + "reports/p3/architecture_parameter_control_comparison.json": "f1ef8504b2464cc2bf93cd8002299269df61373cf7a4a53254f50aa7977b269f", + "reports/p3/architecture_parameter_measurement.json": "86e64af40f76d4291aeb3e8186eb9d48e8fd16191762cab32364ce05435f87ca", + "reports/p3/architecture_parameter_measurement_control.json": "c709ab9f906ebd4ffcaf22516888d18eff6ccfed3576fc5c92ecb37ab55798e3" + }, + "outputs": {}, + "rule": "P3-15'-f criterion-(b) parameter re-derivation", + "schema_version": "1.0", + "script": "src/tbox_finder/mining/architecture_param_recommend.py", + "seed": 42 + }, + "recommendation": { + "anti_selectivity": { + "also_at_the_row_level_for_reference": { + "control_queries_failing_a_and_b": "8/76", + "fp_candidates_failing_a_and_b": "32/278", + "no_interval_because": "neither row unit is independent \u2014 control queries share records and FP candidates share loci \u2014 so these are point counts only" + }, + "control_ci95": [ + 0.060834, + 0.215351 + ], + "control_falls_through_more": false, + "control_records_failing_a_and_b": "8/68", + "control_share": 0.117647, + "fp_ci95": [ + 0.08656, + 0.178877 + ], + "fp_loci_failing_a_and_b": "25/199", + "fp_minus_control_pp": 0.7981, + "fp_share": 0.125628, + "intervals_disjoint": false, + "unit": "control = producible RECORDS; FP arm = decided LOCI", + "what_disjointness_would_and_would_not_mean": "non-overlapping Wilson intervals are a CONSERVATIVE indication of a difference, not a test of one; overlapping intervals do not establish equality either. Read the direction and the size, not the flag." + }, + "bulge_sentinel_comparison": { + "chosen": { + "control_records_losing_a_and_b": 8, + "fp_failed": 52, + "n_mined": 3 + }, + "chosen_bulge_max_nt": 50, + "measures_identically": true, + "sentinel_bulge_max_nt": 10000, + "sentinel_twin": { + "control_records_losing_a_and_b": 8, + "fp_failed": 52, + "n_mined": 3 + }, + "sentinel_twin_admissible": true + }, + "dominating_alternatives": { + "examples_by_yield": [ + { + "control_records_losing_a_and_b": 8, + "n_extra_mined_vs_recommendation": 1, + "n_mined": 4, + "of_n_producible_records": 68, + "params": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 2, + "min_helix_pairs": 3, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + } + }, + { + "control_records_losing_a_and_b": 8, + "n_extra_mined_vs_recommendation": 2, + "n_mined": 5, + "of_n_producible_records": 68, + "params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 3, + "min_helix_pairs": 3, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + } + } + ], + "max_extra_mined": 2, + "n_settings": 8, + "why_the_rule_declines_them": "they are selected BY the two arms, on a few dozen control records, from thousands of grid points (the counts live in grid.n_admissible, yield_ceiling and control_arm.n_records_producible, never in this sentence); the extra yield is a handful of candidates; and the damage coordinate excludes (c), which is the only disjunct with measured discrimination. ADR-0006 A4 asks the round to supply a chosen value and record it \u2014 taking one of these would record a tuned one instead, and nothing downstream would say so." + }, + "floor_sensitivity": { + "bulge_max_nt is bounded": { + "changes_the_selection": false, + "measured_identically_to_the_chosen_setting": null, + "selection_without_this_floor": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + } + }, + "min_helix_pairs >= 2": { + "changes_the_selection": null, + "measured_identically_to_the_chosen_setting": null, + "selection_without_this_floor": null, + "the_rule_cannot_decide_without_it": "the decision rule left 3 settings tied at the measured minimum that TIE_BREAK_ORDER cannot separate \u2014 they disagree on ['min_helix_pairs']: ['mnh2_mhp1_bulge2-50_ncca2_wob0', 'mnh2_mhp2_bulge2-50_ncca2_wob0', 'mnh2_mhp2_bulge2-50_ncca2_wob1']" + }, + "min_named_helices >= 2": { + "changes_the_selection": null, + "measured_identically_to_the_chosen_setting": null, + "selection_without_this_floor": null, + "the_rule_cannot_decide_without_it": "the decision rule left 7 settings tied at the measured minimum that TIE_BREAK_ORDER cannot separate \u2014 they disagree on ['min_helix_pairs', 'min_named_helices']: ['mnh1_mhp2_bulge2-50_ncca2_wob0', 'mnh1_mhp3_bulge2-50_ncca2_wob0', 'mnh1_mhp4_bulge2-50_ncca2_wob0', 'mnh2_mhp2_bulge2-50_ncca2_wob0', 'mnh1_mhp3_bulge2-50_ncca2_wob1', 'mnh1_mhp4_bulge2-50_ncca2_wob1', 'mnh2_mhp2_bulge2-50_ncca2_wob1']" + }, + "ncca_pairing_nt >= 2": { + "changes_the_selection": true, + "measured_identically_to_the_chosen_setting": false, + "selection_without_this_floor": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 1, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 1, + "stem_i_nt_threshold": 1 + } + } + }, + "helix_stack_depth_evidence": { + "control_arm": { + "counts": { + "10": 3, + "11": 5, + "12": 4, + "13": 2, + "14": 4, + "2": 29, + "3": 72, + "4": 28, + "5": 35, + "6": 32, + "7": 7, + "8": 12, + "9": 3 + }, + "max": 14, + "median": 4.0, + "min": 2, + "n": 236, + "percentiles": { + "p50": 4, + "p90": 8, + "p95": 11, + "p99": 14 + } + }, + "fp_arm": { + "counts": { + "10": 12, + "11": 15, + "12": 11, + "13": 25, + "14": 9, + "15": 5, + "2": 144, + "3": 299, + "4": 160, + "5": 114, + "6": 131, + "7": 46, + "8": 18, + "9": 13 + }, + "max": 15, + "median": 4.0, + "min": 2, + "n": 1002, + "percentiles": { + "p50": 4, + "p90": 8, + "p95": 11, + "p99": 14 + } + }, + "source": "helix_arm.helix_stack_depth of each arm's measurement report", + "why_it_is_here": "the min_helix_pairs floor's rationale makes an empirical claim about stack depth; the distribution it appeals to is carried here so the claim is checkable inside the artifact that makes it" + }, + "matches_named_setting": "sensitive_core", + "measured": { + "control_arm": { + "criterion_c_not_in_this_conjunction": "the control's host genomes carry no GFF annotation, so criterion (c) is UNMEASURED on this arm and is absent from the conjunction. Real T-boxes are the population (c) is most likely to spare, so this damage figure is an UPPER bound; the FP arm's yield, by contrast, does include (c).", + "n_queries_a_and_b_failed": 8, + "n_queries_b_failed": 11, + "n_queries_decided": 76, + "n_records_losing_a_and_b": 8, + "n_records_losing_b": 9, + "n_records_producible": 68, + "query_level_ci95": null, + "share_records_losing_a_and_b": 0.117647, + "share_records_losing_a_and_b_ci95": [ + 0.060834, + 0.215351 + ], + "share_records_losing_b": 0.132353, + "share_records_losing_b_ci95": [ + 0.071222, + 0.232803 + ], + "why_no_query_ci": "the control's queries are pseudo-replicated \u2014 most records contribute more than one \u2014 so a binomial interval on them would be narrower than the data support. Every interval here is on the record level." + }, + "fp_arm": { + "failed": 52, + "failed_with_criterion_a_failed": 32, + "loci_decided": 199, + "loci_failing_a_and_b": 25, + "passed": 226, + "share_failed_of_decided": 0.18705, + "unit_note": "the candidate counts are manifest rows; the LOCUS counts collapse candidates addressing the same span from overlapping tiling windows. Every FP interval in this report is on the locus." + }, + "params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "round_yield_n_mined": { + "stage2_not_declared": 3, + "stage2_threshold_0.5": 3, + "stage2_threshold_0.9": 3, + "stage2_threshold_0.95": 3, + "stage2_threshold_0.99": 3 + }, + "round_yield_n_mined_loci": { + "stage2_not_declared": 3, + "stage2_threshold_0.5": 3, + "stage2_threshold_0.9": 3, + "stage2_threshold_0.95": 3, + "stage2_threshold_0.99": 3 + } + }, + "mined_candidate_ids": [ + "GCA_011056645.1:c228:8704:9345-9438", + "GCA_015478585.1:c26:4608:5040-5154", + "GCA_040905065.1:c256:4899:5781-5916" + ], + "n_admissible_points": 2880, + "n_at_the_measured_minimum": 2, + "n_clearing_every_floor": 864, + "params": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + }, + "selection_by_min_named_helices": { + "levels": [ + { + "min_named_helices": 1, + "reading": null, + "selection": null, + "the_rule_cannot_decide_at_this_level": "the decision rule left 7 settings tied at the measured minimum that TIE_BREAK_ORDER cannot separate \u2014 they disagree on ['min_helix_pairs', 'min_named_helices']: ['mnh1_mhp2_bulge2-50_ncca2_wob0', 'mnh1_mhp3_bulge2-50_ncca2_wob0', 'mnh1_mhp4_bulge2-50_ncca2_wob0', 'mnh2_mhp2_bulge2-50_ncca2_wob0', 'mnh1_mhp3_bulge2-50_ncca2_wob1', 'mnh1_mhp4_bulge2-50_ncca2_wob1', 'mnh2_mhp2_bulge2-50_ncca2_wob1']" + }, + { + "control_records_losing_a_and_b": 8, + "fp_arm_failed_of_decided": "52/278", + "matches_named_setting": "sensitive_core", + "min_named_helices": 2, + "of_n_producible_records": 68, + "reading": "the PLURAL reading: D3's pass condition is that 'the expected helices are present' \u2014 plural \u2014 so a setting satisfied by ONE resolved helix is a 'some helix is present' predicate. This is the weakest level at which the published sentence matches D3's wording.", + "round_yield_n_mined": 3, + "selection": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + } + }, + { + "control_records_losing_a_and_b": 24, + "fp_arm_failed_of_decided": "129/278", + "matches_named_setting": null, + "min_named_helices": 3, + "of_n_producible_records": 68, + "reading": "the CANONICAL-CORE reading, and it is stated by this repo's own localizer: architecture.named_elements_present's docstring reads D3 as 'the canonical class-I core is Stem I + Stem III + antiterminator (with Stem II in many lineages)' \u2014 three elements. It is at least as well supported as the plural reading and it prices very differently.", + "round_yield_n_mined": 11, + "selection": { + "allow_wobble": false, + "bulge_max_nt": 50, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 3, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + } + }, + { + "control_records_losing_a_and_b": 31, + "fp_arm_failed_of_decided": "192/278", + "matches_named_setting": null, + "min_named_helices": 4, + "of_n_producible_records": 68, + "reading": null, + "round_yield_n_mined": 13, + "selection": { + "allow_wobble": false, + "bulge_max_nt": 20, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 4, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + } + } + ], + "why_this_block_exists": "the recommendation below is the level-2 row. ADR-0006 D3 assigns this value to the held-out canonical set at P6 and states no number, so choosing the level is a CLAUDE.md \u00a77 decision and every level is priced here rather than one being presented as derived." + }, + "tie_break_exercised": { + "can_fire": { + "allow_wobble": true, + "bulge_max_nt": true, + "stem_i_nt_threshold": false + }, + "note": "an entry over a single-valued axis is inert here by construction, not by measurement of the arms; it is kept so a supply that DID vary that axis would still be resolved by a stated preference rather than by sort order.", + "values_present_on_the_swept_grid": { + "allow_wobble": [ + false, + true + ], + "bulge_max_nt": [ + 10, + 20, + 50, + 10000 + ], + "stem_i_nt_threshold": [ + 1 + ] + } + }, + "tied_with": [ + { + "allow_wobble": true, + "bulge_max_nt": 50, + "bulge_min_nt": 2, + "min_helix_pairs": 2, + "min_named_helices": 2, + "ncca_pairing_nt": 2, + "stem_i_nt_threshold": 1 + } + ], + "what_it_costs": "the frontier above shows what a higher-yield setting would buy and what it would cost in control records; the rule declines those because selecting them is fitting a value to a few dozen records, not choosing one." + }, + "schema_version": "1.0", + "step": "P3-15'-f", + "yield_ceiling": { + "by_stage2_threshold": { + "stage2_not_declared": { + "max_mined_if_b_failed_everywhere": 15, + "max_mined_if_b_failed_everywhere_loci": 12, + "min_mined_if_b_passed_everywhere": 0 + }, + "stage2_threshold_0.5": { + "max_mined_if_b_failed_everywhere": 12, + "max_mined_if_b_failed_everywhere_loci": 10, + "min_mined_if_b_passed_everywhere": 0 + }, + "stage2_threshold_0.9": { + "max_mined_if_b_failed_everywhere": 13, + "max_mined_if_b_failed_everywhere_loci": 11, + "min_mined_if_b_passed_everywhere": 0 + }, + "stage2_threshold_0.95": { + "max_mined_if_b_failed_everywhere": 13, + "max_mined_if_b_failed_everywhere_loci": 11, + "min_mined_if_b_passed_everywhere": 0 + }, + "stage2_threshold_0.99": { + "max_mined_if_b_failed_everywhere": 13, + "max_mined_if_b_failed_everywhere_loci": 11, + "min_mined_if_b_passed_everywhere": 0 + } + }, + "candidate_ids_at_the_ceiling": [ + "GCA_002878375.1:c1:22528:23222-23375", + "GCA_002878375.1:c1:23040:23222-23375", + "GCA_011056645.1:c183:6144:6428-6519", + "GCA_011056645.1:c225:4608:5379-5475", + "GCA_011056645.1:c225:5120:5384-5475", + "GCA_011056645.1:c228:8704:9345-9438", + "GCA_015478585.1:c26:4608:5040-5154", + "GCA_023663235.1:c13:22528:23157-23220", + "GCA_023663235.1:c13:23040:23157-23220", + "GCA_023663235.1:c7:26112:26818-26885", + "GCA_023663235.1:c7:26624:26818-26885", + "GCA_039638295.1:c67:3584:3891-3985", + "GCA_039638295.1:c72:0:75-164", + "GCA_040905065.1:c256:4899:5781-5916", + "GCF_041320495.1:c21:554496:554947-555043" + ], + "distinct_loci_at_the_ceiling": 12, + "n_candidates": 941, + "n_criterion_a_failed": 111, + "n_criterion_c_failed": 96, + "n_failing_both_a_and_c": 15, + "n_failing_both_a_and_c_with_a_consensus": 15, + "reading": "sparing is a disjunction (ADR-0005 D14), so mining is a conjunction: only a candidate every disjunct scored 'failed' is mined. Criterion (b) can therefore act at all only inside the (a)-failed AND (c)-failed intersection; outside it (b)'s verdict changes no outcome. max_mined_if_b_failed_everywhere is the ceiling the parameter choice is bounded by \u2014 no setting can exceed it \u2014 and min_mined_if_b_passed_everywhere is 0 by the structure of the rule, not by measurement \u2014 (b) passing everywhere spares everything \u2014 and is emitted only so the band has both ends. \u26a0 Read the LOCUS count beside the candidate count: the manifest tiles overlapping windows, so some of these rows are second calls on one piece of DNA.", + "stage2_threshold_note": "ADR-0005 D3/D14 freeze the Stage-2 threshold at the \u00a713.1 phase gate; none is pinned here. 'stage2_not_declared' is the P2 accounting (the disjunct is not in play) and is an UPPER bound: declaring Stage-2 at any threshold can only spare more.", + "status_counts": { + "criterion_a_covariation": { + "failed": 111, + "passed": 167, + "unavailable": 663 + }, + "criterion_c_synteny": { + "failed": 96, + "passed": 546, + "unavailable": 299 + } + } + } +} diff --git a/src/tbox_finder/mining/architecture_param_recommend.py b/src/tbox_finder/mining/architecture_param_recommend.py new file mode 100644 index 00000000..6641e43f --- /dev/null +++ b/src/tbox_finder/mining/architecture_param_recommend.py @@ -0,0 +1,1993 @@ +"""Re-derive criterion (b)'s seven ADR-0006 A4 rule parameters, over the whole grid. + +`P3-15′-f` measured (b) on 278 de-novo consensuses of round-0 **false-positive-manifest** +candidates and put seven parameter values to the user; the user declined to pin them on +that evidence and asked for a **matched positive control** first (§7, 2026-08-09). +`P3-15′-g`/`-g-ii`/`-g-iii`/`-g-iv` built and measured that control. `P3-15′-f`'s block +asked for its recommendation to be **re-derived, not re-quoted**, once the control landed. +This module is that re-derivation, and it changes what the choice is *about*. + +Three things this module derives that no committed report states +================================================================ +1. **The round's yield ceiling, before (b) is chosen at all.** Sparing is a disjunction + (ADR-0005 D14), so mining is a *conjunction*: a candidate is mined only if criterion + (a) **and** (b) **and** (c) **and** — at P3 — the Stage-2 disjunct all resolve + ``failed``. Criterion (a) fails on 111 of 941 and criterion (c) on 96; their + **intersection** is what (b) can ever act on. Everything (b) decides outside that + intersection changes no outcome. +2. **What (b)'s parameters are worth in mined candidates**, computed through the shipped + :func:`tbox_finder.mining.spare_rule.is_mining_excluded` rather than a re-derived + conjunction, over **every admissible point of the grid** — not the six named tuples + the two measurement reports happen to carry. +3. **What each point costs on known T-boxes**, at the record level the matched control's + pseudo-replication permits (149 of its 160 records contribute 2 queries), and — the + quantity that actually decides label noise — the share of control records that fall + through **(a) and (b) together**, which is not the same object as (b)'s own failure + share and does not behave like it. + +Why the recommendation is rule-first, and why that matters here +=============================================================== +The admissible grid has thousands of points and the control has 68 producible records. +An argmax over that grid is a fitted value with no out-of-sample warrant, and ADR-0006 A4 +requires the round to *supply* a value and record it — a **chosen rule**, not a tuned one. +So :data:`DECISION_FLOORS` is stated from ADR-0006 D3's own wording and ADR-0004 D1's +element vocabulary **before** any count is read, the floors are applied, and the winner is +whichever admissible survivor is **most permissive as measured** — permissiveness being +the fail-closed direction for a sparing disjunct, by A4's own argument. The frontier of +higher-yield settings is reported in full so the reader can see exactly what the rule +declines to take, and why taking it would be fitting. + +This module **pins nothing** (``pins_nothing: true``). The value is the user's §7 call and +enters the round through the producer's seven ``${VAR:?}`` exports, recorded in provenance +per A4; D6/D17's P6 freeze is untouched. + +Run:: + + PYTHONPATH=src python -m tbox_finder.mining.architecture_param_recommend build-inputs \\ + --covariation-status \\ + --synteny-status \\ + --stage2-posteriors \\ + --out data/processed/mining/round0_fp_spare_rule_inputs_v0.json + + PYTHONPATH=src python -m tbox_finder.mining.architecture_param_recommend recommend \\ + --fp-msa-root /msa.sto from round_p3_15_supply> \\ + --control-msa-root /msa.sto from round_p3_15g_control> \\ + --out reports/p3/architecture_parameter_recommendation.json +""" + +from __future__ import annotations + +import argparse +import json +import sys +from collections.abc import Callable, Iterable, Mapping, Sequence +from dataclasses import dataclass +from pathlib import Path +from typing import Any + +from tbox_finder.mining import architecture as arch +from tbox_finder.mining.architecture_param_control_compare import load_control_records +from tbox_finder.mining.architecture_param_measure import ( + BULGE_MAX_NT_SWEEP, + BULGE_MIN_NT_SWEEP, + MIN_HELIX_PAIRS_SWEEP, + MIN_NAMED_HELICES_SWEEP, + NCCA_PAIRING_NT_SWEEP, + ParamTuple, + SupplyItem, + candidate_state, + default_tuples, + is_inside_repo, + is_local_path_shaped, + portable_path, + read_supply, + sha256_of, + supply_digest, +) +from tbox_finder.mining.architecture_producer import ( + ProducerError, + candidate_id_of, + candidate_msa_path, +) +from tbox_finder.mining.curated_control_sizing import wilson_interval +from tbox_finder.mining.spare_rule import ( + DISJUNCT_STATUSES, + STATUS_FAILED, + STATUS_PASSED, + STATUS_UNAVAILABLE, + SpareRuleEvidence, + is_mining_excluded, +) +from tbox_finder.provenance import build_provenance + +SCHEMA_VERSION = "1.0" +STEP = "P3-15'-f" +ADR = ( + "ADR-0006 D3 (criterion (b)'s named-element predicate), D6 (the short-Stem-I " + "relaxation), A4 (the seven rule parameters supplied per round, no defaults); " + "ADR-0005 D14 (the spare rule: sparing is a disjunction, so mining is a " + "conjunction; unavailable spares); ADR-0004 D1 (the element vocabulary D3 reuses)" +) + +#: The sentinel on the ``bulge_max_nt`` axis that means "no upper bound at all". A +#: setting carrying it has no bulge *size* filter: only ``bulge_min_nt`` decides. +BULGE_MAX_UNBOUNDED = 10_000 + +#: The two states a consensus can be in once it exists (``unavailable`` is its absence). +DECIDED_STATES: tuple[str, ...] = (STATUS_PASSED, STATUS_FAILED) + +#: Stage-2 thresholds the yield is reported *across*. ADR-0005 D3/D14 freeze the real +#: value at the §13.1 phase gate and this module pins none of them — the list exists so +#: the ceiling is quoted as a band rather than at one unowned number. +STAGE2_THRESHOLD_SENSITIVITY: tuple[float, ...] = (0.5, 0.9, 0.95, 0.99) + + +class RecommendError(ValueError): + """The recommendation could not be derived from the inputs as given.""" + + +def locus_of(candidate_id: str) -> str: + """``accession:contig:start-end`` — the LOCUS an FP candidate id addresses. + + A round-0 candidate id is ``accession:contig:window:start-end``: the window offset is + the tiling frame the scanner happened to be in, not part of the locus. Two candidates + from overlapping windows that call the same span are **the same piece of DNA**, and on + this supply 79 such pairs sit among the 278 (a)-decided candidates — byte-identical + ``msa.sto``, identical (a) and (c) status, identical (b) verdicts at every named + setting. Counting them as two observations makes every FP interval too narrow, which + is exactly the pseudo-replication the control arm is refused an interval for; the two + arms must be treated alike or the comparison is rigged in the FP arm's favour. + """ + parts = str(candidate_id).split(":") + # EXACTLY four. A fifth field would silently drop the middle ones and merge this + # candidate into another locus, shrinking every locus denominator with no refusal — + # the same failure `control_records` refuses for the record grouping. + if len(parts) != 4: + raise RecommendError( + f"candidate_id {candidate_id!r} is not accession:contig:window:start-end " + f"(it has {len(parts)} colon-separated fields, not 4), so its locus cannot be " + "derived; refusing rather than treating the id as a locus" + ) + return ":".join([*parts[:2], parts[-1]]) + + +# ═════════════════════════════════════════════════════════════════════════════ +# The decision rule — stated from the documents, before any count is read +# ═════════════════════════════════════════════════════════════════════════════ +@dataclass(frozen=True) +class DecisionFloor: + """One admissibility floor on the grid, with the sentence it comes from. + + A floor is a *semantic* requirement on what the published predicate may be + described as testing — never a threshold tuned against the arms. ``predicate`` + is what the code applies; ``rationale`` and ``source`` are what the report + prints beside it, so a reader can reject the floor rather than reverse-engineer it. + """ + + key: str + predicate: Callable[[ParamTuple], bool] + rationale: str + source: str + + def as_dict(self) -> dict[str, Any]: + return {"floor": self.key, "rationale": self.rationale, "source": self.source} + + +#: The ``min_named_helices`` levels the rule is run at. ⚠ This axis is **the §7 choice**, +#: not a derivation — see :data:`MIN_NAMED_HELICES_READINGS`. +MIN_NAMED_HELICES_LEVELS: tuple[int, ...] = tuple(MIN_NAMED_HELICES_SWEEP) + +#: Why the level is the user's and not this module's. Two readings of the SAME D3 phrase +#: are supported by documents in this repo and they disagree materially. +MIN_NAMED_HELICES_READINGS: Mapping[int, str] = { + 2: ( + "the PLURAL reading: D3's pass condition is that 'the expected helices are " + "present' — plural — so a setting satisfied by ONE resolved helix is a 'some " + "helix is present' predicate. This is the weakest level at which the published " + "sentence matches D3's wording." + ), + 3: ( + "the CANONICAL-CORE reading, and it is stated by this repo's own localizer: " + "architecture.named_elements_present's docstring reads D3 as 'the canonical " + "class-I core is Stem I + Stem III + antiterminator (with Stem II in many " + "lineages)' — three elements. It is at least as well supported as the plural " + "reading and it prices very differently." + ), +} + + +DECISION_FLOORS: tuple[DecisionFloor, ...] = ( + DecisionFloor( + key="min_named_helices >= 2", + predicate=lambda p: p.min_named_helices >= 2, + rationale=( + "⚠ THIS FLOOR'S LEVEL IS A §7 READING, NOT A DERIVATION, AND IT DECIDES THE " + "HEADLINE. D3 says 'the expected helices are present' and assigns the value to " + "the held-out canonical set at P6; it contains no number. Two readings are " + "supported: PLURAL (>= 2, this floor) and CANONICAL CORE (>= 3, which " + "architecture.named_elements_present's own docstring states). " + "recommendation.selection_by_min_named_helices prices every level, and the " + "level is put to the project lead rather than settled here. The floor is set " + "at 2 only because a sparing disjunct's fail-closed direction is the more " + "permissive one (ADR-0006 A4). ⚠ Note also that min_named_helices counts " + "RESOLVED helices of sufficient stacking depth, not identified D1 elements — " + "the localizer has no element identity to check — so 'the expected helices are " + "present' is operationalised as a count throughout." + ), + source="ADR-0006 D3 (no number; P6-delegated) + A4; the competing reading is in " + "src/tbox_finder/mining/architecture.py::named_elements_present", + ), + DecisionFloor( + key="min_helix_pairs >= 2", + predicate=lambda p: p.min_helix_pairs >= 2, + rationale=( + "min_helix_pairs is the number of stacked pairs at which a run of pairing " + "counts as a helix at all. At 1 a single isolated base pair is a named " + "structural element. ⚠ ADR-0006 D3 contains NO concept of stacked-pair depth, " + "so this floor is an ASSUMPTION about what the word 'helix' may denote, not a " + "reading of the ADR; it is listed here so it can be rejected. Its empirical " + "side is published beside it in helix_stack_depth_evidence, and on this supply " + "the settings it excludes measure identically to the chosen one, so it costs " + "nothing measurable either way." + ), + source="an ASSUMPTION of this module, not an ADR clause — see the rationale", + ), + DecisionFloor( + key="ncca_pairing_nt >= 2", + predicate=lambda p: p.ncca_pairing_nt >= 2, + rationale=( + "D3 requires an 'NCCA-PAIRING bulge'. One satisfied contact in the acceptor " + "register is a coincidence at these alignment widths, not a register; two is " + "the weakest reading under which the word 'pairing' is doing work." + ), + source="ADR-0006 D3", + ), + DecisionFloor( + key="bulge_max_nt is bounded", + predicate=lambda p: p.bulge_max_nt != BULGE_MAX_UNBOUNDED, + rationale=( + "bulge_max_nt = 10000 is the axis's no-upper-bound sentinel: the size filter " + "stops filtering and bulge_min_nt alone decides. A round may choose that, but " + "it may not then describe (b) as testing a bulge SIZE. ⚠ This floor is " + "semantic, not decisive, and the claim that it costs nothing is measured " + "rather than argued: see recommendation.bulge_sentinel_comparison, which puts " + "the chosen setting against its own sentinel twin. It is NOT readable off " + "floor_sensitivity, whose identity field is null here precisely because " + "dropping this floor does not move the selection." + ), + source="ADR-0006 D3; ADR-0006 A4 (the value is recorded and must mean what it says)", + ), +) + +#: Applied to the survivors of :data:`DECISION_FLOORS`, in order, only to break an exact +#: measured tie. Every entry resolves toward the value that CLAIMS LESS. +TIE_BREAK_ORDER: tuple[tuple[str, str], ...] = ( + ( + "allow_wobble", + "False — the flag is proved structurally inert for the NCCA acceptor, so recording " + "it as enabled would publish a relaxation that cannot fire", + ), + ( + "stem_i_nt_threshold", + "the smallest value on the axis — the D6 relaxation is proved inert on this " + "manifest (neither stem_i_extent_nt nor regulatory_mode is supplied), and the " + "smallest value is the one under which it demonstrably never fires", + ), + ( + "bulge_max_nt", + "the smallest bounded value among exact ties — a narrower stated filter, given the " + "wider one measured identically", + ), +) + +#: The parameters TIE_BREAK_ORDER can speak to. Derived from it rather than restated, so +#: adding a tie-break entry cannot leave the refusal below guarding a stale vocabulary. +TIE_BREAK_VOCABULARY: tuple[str, ...] = tuple(name for name, _ in TIE_BREAK_ORDER) + +DECISION_RULE_STATEMENT = ( + "Stated before any count was read. (1) Keep only points the SHIPPED localizer accepts " + "on this supply — admissibility is measured by running it, not by re-encoding its " + "guards. (2) Keep only points that clear every DECISION_FLOORS entry, each of which is " + "a semantic requirement read off ADR-0006 D3's wording, not a tuned threshold. " + "(3) Among the survivors choose the MOST PERMISSIVE as measured — the smallest number " + "of FP-arm consensuses moved to 'failed'. Permissiveness is the fail-closed direction " + "for a SPARING disjunct, and ADR-0006 A4 makes that argument itself: a relaxation " + "'only ever makes (b) more likely to pass => more sparing => the fail-closed " + "direction, so an imperfect value errs safe'. (4) Break exact ties by TIE_BREAK_ORDER, " + "and REFUSE if a tie survives among parameters not proved inert. " + "⚠ What this rule deliberately does NOT do is maximise yield over the grid: with " + "thousands of admissible points and a control of a few dozen producible records, the " + "argmax is a fitted value, and A4 asks the round to supply a chosen one. Every count " + "lives in the derived blocks (grid.n_admissible, control_arm.n_records_producible), " + "never in this sentence, so the prose cannot go stale against its own run." +) + + +# ═════════════════════════════════════════════════════════════════════════════ +# The grid +# ═════════════════════════════════════════════════════════════════════════════ +def grid_points(stem_i_nt_threshold: int = 1) -> tuple[ParamTuple, ...]: + """Every point of the six-axis cross product the two measurement reports sweep. + + ``stem_i_nt_threshold`` is not an axis of that sweep — it is proved inert on both + manifests (neither supplies ``stem_i_extent_nt`` nor ``regulatory_mode``), so the + reports carry it as a fixed value and so does this grid. It is a parameter here + rather than a literal so a manifest that DID supply those fields could be swept + without editing the enumeration. + """ + out: list[ParamTuple] = [] + for mnh in MIN_NAMED_HELICES_SWEEP: + for mhp in MIN_HELIX_PAIRS_SWEEP: + for bmin in BULGE_MIN_NT_SWEEP: + for bmax in BULGE_MAX_NT_SWEEP: + for ncca in NCCA_PAIRING_NT_SWEEP: + for wob in (False, True): + out.append( + ParamTuple( + label=( + f"mnh{mnh}_mhp{mhp}_bulge{bmin}-{bmax}" + f"_ncca{ncca}_wob{int(wob)}" + ), + stem_i_nt_threshold=stem_i_nt_threshold, + min_named_helices=mnh, + min_helix_pairs=mhp, + bulge_min_nt=bmin, + bulge_max_nt=bmax, + ncca_pairing_nt=ncca, + allow_wobble=wob, + ) + ) + return tuple(out) + + +def sweep_arm( + items: Sequence[SupplyItem], + params: ParamTuple, +) -> dict[str, str] | str: + """Per-slug (b) verdicts at ``params``, or the refusal string the shipped path raised. + + Admissibility is **measured**: the localizer refuses a setting whose bulge size floor + is shorter than its NCCA register (a bulge that passes the size filter but cannot hold + the motif would read ``absent`` ⇒ minable rather than ``undetectable`` ⇒ spared). + Re-encoding that guard here would let the two drift, and the drift direction is a grid + point silently scored as if it were legal. + """ + verdicts: dict[str, str] = {} + for item in items: + try: + verdicts[item.slug] = candidate_state(item, params) + except arch.ArchitectureError as exc: + return str(exc) + return verdicts + + +# ═════════════════════════════════════════════════════════════════════════════ +# The spare-rule inputs (criterion (a), criterion (c), the Stage-2 posterior) +# ═════════════════════════════════════════════════════════════════════════════ +def checked_status(where: str, cid: str, field: str, value: Any) -> str: + """One disjunct status, validated. Shared by the writer and the reader. + + Two copies of this rule is how the committed table came to be written without the + check the loader applies: ``build_inputs`` wrote ``str(value)`` and + ``load_spare_rule_inputs`` refused a bad one only on the *next* command, after the file + existed ([[guard-runs-after-what-it-guards]]). + """ + if value not in DISJUNCT_STATUSES: + raise RecommendError( + f"{where}: {cid} has {field}={value!r}, expected one of {tuple(DISJUNCT_STATUSES)}" + ) + return str(value) + + +def checked_posterior(where: str, cid: str, value: Any) -> float | None: + """One Stage-2 posterior, validated. Shared by the writer and the reader. + + ⚠ ``bool`` subclasses ``int``, so ``float(True)`` is ``1.0`` — a value that is not a + posterior at all, which then clears every threshold in + :data:`STAGE2_THRESHOLD_SENSITIVITY` and **spares** the candidate. Committing it would + put it beyond the loader's reach, because by then the column really is a float. + """ + if value is None: + return None + if isinstance(value, bool) or not isinstance(value, (int, float)): + raise RecommendError(f"{where}: {cid} has a non-numeric stage2_posterior") + try: + # ⚠ `float(10**400)` raises OverflowError — an ArithmeticError, outside `main`'s + # except tuple, so a JSON integer too large for a float ended the CLI in a + # traceback rather than in the refusal this function exists to give. `1e400` + # parses to `inf` instead and is caught by the range test below. + numeric = float(value) + except OverflowError as exc: + raise RecommendError( + f"{where}: {cid} has a stage2_posterior too large to represent as a float" + ) from exc + if not 0.0 <= numeric <= 1.0: + raise RecommendError( + f"{where}: {cid} has stage2_posterior={value!r} outside [0, 1]; a mis-scaled " + "column would clear every threshold without a refusal" + ) + return numeric + + +def load_spare_rule_inputs(path: str | Path) -> dict[str, Any]: + """The committed 941-row join, validated rather than trusted. + + Committed for the same reason ``curated_control_status_v0.json`` is: the yield + arithmetic below is the load-bearing number of this step and it must be auditable + without cluster access. + """ + try: + payload = json.loads(Path(path).read_text(encoding="utf-8")) + except (OSError, ValueError) as exc: + raise RecommendError(f"{path}: cannot read spare-rule inputs ({exc})") from exc + if not isinstance(payload, Mapping): + raise RecommendError(f"{path}: spare-rule inputs must be a JSON object") + rows = payload.get("rows") + if not isinstance(rows, list) or not rows: + raise RecommendError(f"{path}: spare-rule inputs carry no rows") + by_id: dict[str, dict[str, Any]] = {} + for row in rows: + if not isinstance(row, Mapping): + raise RecommendError(f"{path}: a spare-rule input row is not an object") + cid = row.get("candidate_id") + if not isinstance(cid, str) or not cid: + raise RecommendError(f"{path}: a spare-rule input row carries no candidate_id") + if cid in by_id: + # A dict comprehension would have MERGED the duplicate and every derived + # count would still reconcile ([[duplicate-key-merges-instead-of-colliding]]). + raise RecommendError(f"{path}: duplicate candidate_id {cid!r}") + for field in ("covariation_status", "synteny_status"): + checked_status(str(path), cid, field, row.get(field)) + checked_posterior(str(path), cid, row.get("stage2_posterior")) + by_id[cid] = dict(row) + payload = dict(payload) + payload["by_id"] = by_id + return payload + + +def read_manifest_ids(path: str | Path) -> list[str]: + """The FP manifest's candidate ids, with the file's SHAPE refused rather than assumed. + + Both call sites read ``manifest.get("candidates", manifest)``, meaning to accept two + shapes: an object carrying a ``candidates`` list, or the rows themselves. The second + shape never worked — a top-level JSON list has no ``.get``, so the read raised + ``AttributeError``, which is outside ``main``'s ``(RecommendError, ValueError, + TypeError, OSError, KeyError)`` and ended the CLI in a traceback instead of the + ``refused:`` path this module standardises on. A JSON object *without* ``candidates`` + was worse: it fell back to the mapping itself and iterated its KEYS. + + One reader for both sites, so a fix to one cannot leave the other behind + ([[fixed-one-of-two-identical-things]]); the shape guard is the same one + ``architecture_param_measure`` and ``architecture_producer`` already apply, restated + here only because their errors (``MeasureError``/``ProducerError``, a ``RuntimeError``) + escape this module's refusal path too. + """ + try: + payload = json.loads(Path(path).read_text(encoding="utf-8")) + except (OSError, ValueError) as exc: + raise RecommendError(f"{portable_path(path)}: cannot read the manifest ({exc})") from exc + rows = payload.get("candidates") if isinstance(payload, Mapping) else payload + if not isinstance(rows, list) or not rows: + raise RecommendError( + f"{portable_path(path)}: the manifest carries no candidate rows — it must be a " + "JSON object with a 'candidates' list, or that list itself" + ) + n_non_rows = sum(1 for row in rows if not isinstance(row, Mapping)) + if n_non_rows: + # ⚠ Refused, not skipped: `architecture_producer.read_manifest` DROPS a non-object + # row, which here would silently shrink the 941 denominator that the coverage + # check, the ceiling and the yield are all computed against. + raise RecommendError( + f"{portable_path(path)}: {n_non_rows} manifest row(s) are not objects; a " + "candidate row must carry 'candidate_id' or 'id'" + ) + try: + return [candidate_id_of(row) for row in rows] + except ProducerError as exc: + # A RuntimeError, so `main` would not catch it either. + raise RecommendError(f"{portable_path(path)}: {exc}") from exc + + +def assert_manifest_ids_distinct(manifest_ids: Sequence[str]) -> None: + """A manifest id appearing twice is refused rather than counted twice. + + Every corpus size in this report — the 941 denominator, the ceiling, the yield — is + ``len(manifest_ids)``, while every join against it goes through a **set**. A + duplicated id therefore inflates the denominator while the coverage check still reads + as exact, and each derived share is quietly computed against the wrong ``n`` + ([[duplicate-key-merges-instead-of-colliding]]). + """ + seen: set[str] = set() + dupes = sorted({cid for cid in manifest_ids if cid in seen or seen.add(cid)}) + if dupes: + raise RecommendError( + f"the manifest carries {len(dupes)} duplicated candidate_id(s), e.g. " + f"{dupes[:2]}; every corpus size here is a row count and every join is a set, " + "so a duplicate would inflate one and not the other" + ) + + +def assert_covers_manifest(by_id: Mapping[str, Any], manifest_ids: Sequence[str]) -> None: + """Exact set equality with the manifest — an extra id is as fatal as a missing one.""" + assert_manifest_ids_distinct(manifest_ids) + want, have = set(manifest_ids), set(by_id) + if want == have: + return + missing, extra = sorted(want - have), sorted(have - want) + raise RecommendError( + f"spare-rule inputs do not cover the manifest: {len(missing)} missing " + f"(e.g. {missing[:2]}), {len(extra)} extra (e.g. {extra[:2]})" + ) + + +def evidence_for( + row: Mapping[str, Any], + architecture_status: str, +) -> SpareRuleEvidence: + """One candidate's four-disjunct evidence, in the shipped dataclass.""" + return SpareRuleEvidence( + relaxed_architecture=architecture_status, + any_helix_rscape=str(row["covariation_status"]), + downstream_aaRS_synteny=str(row["synteny_status"]), + stage2_posterior=row.get("stage2_posterior"), + ) + + +def mined_ids( + by_id: Mapping[str, Mapping[str, Any]], + arch_status: Mapping[str, str], + *, + stage2_threshold: float | None, +) -> list[str]: + """Every candidate the round would MINE, through the shipped spare rule. + + ``arch_status`` is keyed by candidate id and may omit ids: a candidate with no + consensus has no (b) verdict, which the producer scores ``unavailable`` ⇒ spared. + That default is supplied here rather than assumed by the caller, because the + fail-open version of this function is the one that mines the whole corpus. + """ + out: list[str] = [] + for cid, row in by_id.items(): + evidence = evidence_for(row, arch_status.get(cid, STATUS_UNAVAILABLE)) + if not is_mining_excluded(evidence, stage2_threshold=stage2_threshold): + out.append(cid) + return sorted(out) + + +def yield_ceiling( + by_id: Mapping[str, Mapping[str, Any]], + *, + ids_with_consensus: Sequence[str], +) -> dict[str, Any]: + """What the round can mine at MOST, over every possible criterion-(b) verdict. + + Computed by handing the shipped spare rule the two extreme (b) columns — + ``failed`` everywhere (maximally minable) and ``passed`` everywhere (maximally + sparing). The gap between them is the whole of what choosing (b)'s parameters can + move; the ceiling itself is set by (a), (c) and Stage-2 and no (b) value can raise it. + """ + all_failed = {cid: STATUS_FAILED for cid in ids_with_consensus} + all_passed = {cid: STATUS_PASSED for cid in ids_with_consensus} + counts = { + criterion: { + state: sum(1 for r in by_id.values() if r[column] == state) + for state in DISJUNCT_STATUSES + } + for criterion, column in ( + ("criterion_a_covariation", "covariation_status"), + ("criterion_c_synteny", "synteny_status"), + ) + } + a_failed = {cid for cid, r in by_id.items() if r["covariation_status"] == STATUS_FAILED} + c_failed = {cid for cid, r in by_id.items() if r["synteny_status"] == STATUS_FAILED} + both = a_failed & c_failed + band: dict[str, Any] = {} + for threshold in (None, *STAGE2_THRESHOLD_SENSITIVITY): + key = "stage2_not_declared" if threshold is None else f"stage2_threshold_{threshold}" + maxed = mined_ids(by_id, all_failed, stage2_threshold=threshold) + band[key] = { + "max_mined_if_b_failed_everywhere": len(maxed), + "max_mined_if_b_failed_everywhere_loci": len({locus_of(c) for c in maxed}), + "min_mined_if_b_passed_everywhere": len( + mined_ids(by_id, all_passed, stage2_threshold=threshold) + ), + } + return { + "n_candidates": len(by_id), + "status_counts": counts, + "n_criterion_a_failed": len(a_failed), + "n_criterion_c_failed": len(c_failed), + "n_failing_both_a_and_c": len(both), + "n_failing_both_a_and_c_with_a_consensus": len(both & set(ids_with_consensus)), + # Named, not just counted: 15 ids is small enough to publish, and a ceiling a + # reader cannot check against the manifest is a number they have to take on trust. + "candidate_ids_at_the_ceiling": mined_ids(by_id, all_failed, stage2_threshold=None), + "distinct_loci_at_the_ceiling": len( + {locus_of(c) for c in mined_ids(by_id, all_failed, stage2_threshold=None)} + ), + "by_stage2_threshold": band, + "reading": ( + "sparing is a disjunction (ADR-0005 D14), so mining is a conjunction: only a " + "candidate every disjunct scored 'failed' is mined. Criterion (b) can therefore " + "act at all only inside the (a)-failed AND (c)-failed intersection; outside it " + "(b)'s verdict changes no outcome. max_mined_if_b_failed_everywhere is the " + "ceiling the parameter choice is bounded by — no setting can exceed it — and " + "min_mined_if_b_passed_everywhere is 0 by the structure of the rule, not by " + "measurement — (b) passing everywhere spares everything — and is emitted only " + "so the band has both ends. ⚠ Read the LOCUS count beside the candidate count: " + "the manifest tiles overlapping windows, so some of these rows are second " + "calls on one piece of DNA." + ), + "stage2_threshold_note": ( + "ADR-0005 D3/D14 freeze the Stage-2 threshold at the §13.1 phase gate; none is " + "pinned here. 'stage2_not_declared' is the P2 accounting (the disjunct is not " + "in play) and is an UPPER bound: declaring Stage-2 at any threshold can only " + "spare more." + ), + } + + +# ═════════════════════════════════════════════════════════════════════════════ +# The control arm — record-level, because its queries are pseudo-replicated +# ═════════════════════════════════════════════════════════════════════════════ +def control_records( + status: Mapping[str, str], + manifest_path: str | Path, + *, + status_path: str | Path | None = None, +) -> dict[str, list[str]]: + """``record -> its query ids``, read from the MANIFEST, not parsed out of the ids. + + ``record_of``'s own docstring forbids deriving the grouping from the id string, and + for the reason that matters here: a supply whose ids carried a second context field + would silently split or merge records, moving ``n_records_producible`` and every + interval computed on it while all the query totals still reconciled. The shipped + :func:`load_control_records` reads ``accession`` from the manifest and refuses a row + whose two statements about its own record disagree; this function delegates to it and + then checks the status table is that same corpus. + """ + # ⚠ The VALUES, not only the id set. `control_damage` reads producibility as + # `status[q] in DECIDED_STATES`, so an unspellable status — a typo, a null, a JSON + # number — silently drops that query out of the 68-record denominator every rate and + # interval on this arm is computed against. The FP arm's two status columns go through + # `checked_status` in both the writer and the reader; this one did not, and an + # asymmetric guard is the one that gets forgotten. (The reachable case is already + # refused downstream by `assert_supply_is_the_decided_set`, which would see the id + # leave the decided set while its consensus sits on disk — but that is a guard about + # the SUPPLY, and it names a different cause.) + if not isinstance(status, Mapping): + raise RecommendError("the control status table must be a JSON object of id → status") + # ⚠ The STATUS table's path, not the manifest's: `checked_status` prints its first + # argument as where the bad value lives, and a refusal that sends the reader to the + # wrong file is a refusal they will disbelieve. `status_path` is optional because the + # caller may hold the table without a path (the tests do). + where = portable_path(status_path) if status_path is not None else "the control status table" + for cid, value in status.items(): + checked_status(where, str(cid), "control status", value) + by_record = load_control_records(manifest_path) + manifest_ids = {cid for ids in by_record.values() for cid in ids} + if manifest_ids != set(status): + missing = sorted(manifest_ids - set(status)) + extra = sorted(set(status) - manifest_ids) + raise RecommendError( + f"the control status table and the control manifest are different corpora: " + f"{len(missing)} manifest id(s) unscored (e.g. {missing[:2]}), {len(extra)} " + f"scored id(s) absent from the manifest (e.g. {extra[:2]})" + ) + return {rec: sorted(ids) for rec, ids in sorted(by_record.items())} + + +def control_damage( + status: Mapping[str, str], + records: Mapping[str, Sequence[str]], + arch_by_query: Mapping[str, str], +) -> dict[str, Any]: + """What a setting costs on KNOWN T-boxes, in the two units that are defensible. + + ``all_disjuncts_failed`` is the quantity that decides label noise: a record is + damaged only where **every** producible query of it fails (a) *and* (b), because + any surviving pass spares it. ⚠ Criterion (c) is **not** in this conjunction — the + control's host genomes were never annotated, so (c) is unmeasured on this arm. The + number is therefore an **upper bound** on the damage, and the direction is stated + rather than absorbed. + """ + n_producible = 0 + n_records_ab_failed = 0 + n_records_b_failed = 0 + q_decided = 0 + q_b_failed = 0 + q_ab_failed = 0 + for queries in records.values(): + producible = [q for q in queries if status[q] in DECIDED_STATES] + if not producible: + continue + n_producible += 1 + q_decided += len(producible) + b_states = [arch_by_query.get(q, STATUS_UNAVAILABLE) for q in producible] + q_b_failed += sum(1 for s in b_states if s == STATUS_FAILED) + q_ab_failed += sum( + 1 + for q, s in zip(producible, b_states, strict=True) + if s == STATUS_FAILED and status[q] == STATUS_FAILED + ) + if all(s == STATUS_FAILED for s in b_states): + n_records_b_failed += 1 + if all( + s == STATUS_FAILED and status[q] == STATUS_FAILED + for q, s in zip(producible, b_states, strict=True) + ): + n_records_ab_failed += 1 + if not n_producible: + # wilson_interval raises SizingError below 1 and the shares divide by zero — both + # escape as something other than this module's refusal, and a caller catching + # RecommendError would see a traceback instead of a named cause. anti_selectivity + # already guards its denominators; these two paths must agree. + raise RecommendError( + "no control record has a producible query: the control status table and the " + "supply describe no decided corpus, so there is no damage denominator" + ) + lo, hi = wilson_interval(n_records_ab_failed, n_producible) + lo_b, hi_b = wilson_interval(n_records_b_failed, n_producible) + return { + "n_records_producible": n_producible, + "n_records_losing_b": n_records_b_failed, + "share_records_losing_b": round(n_records_b_failed / n_producible, 6), + "share_records_losing_b_ci95": [round(lo_b, 6), round(hi_b, 6)], + "n_records_losing_a_and_b": n_records_ab_failed, + "share_records_losing_a_and_b": round(n_records_ab_failed / n_producible, 6), + "share_records_losing_a_and_b_ci95": [round(lo, 6), round(hi, 6)], + "n_queries_decided": q_decided, + "n_queries_b_failed": q_b_failed, + "n_queries_a_and_b_failed": q_ab_failed, + "query_level_ci95": None, + "why_no_query_ci": ( + "the control's queries are pseudo-replicated — most records contribute more " + "than one — so a binomial interval on them would be narrower than the data " + "support. Every interval here is on the record level." + ), + "criterion_c_not_in_this_conjunction": ( + "the control's host genomes carry no GFF annotation, so criterion (c) is " + "UNMEASURED on this arm and is absent from the conjunction. Real T-boxes are " + "the population (c) is most likely to spare, so this damage figure is an UPPER " + "bound; the FP arm's yield, by contrast, does include (c)." + ), + } + + +# ═════════════════════════════════════════════════════════════════════════════ +# One grid point, both arms +# ═════════════════════════════════════════════════════════════════════════════ +@dataclass(frozen=True) +class PointResult: + """Everything measured at one admissible grid point.""" + + params: ParamTuple + fp_failed: int + fp_passed: int + fp_failed_with_a_failed: int + #: The same two counts at the LOCUS level — the FP arm's independent unit. + fp_loci_decided: int + fp_loci_failing_a_and_b: int + mined_by_threshold: Mapping[str, int] + mined_loci_by_threshold: Mapping[str, int] + control: Mapping[str, Any] + + @property + def mined(self) -> int: + """Yield with the Stage-2 disjunct not declared — the upper bound.""" + return int(self.mined_by_threshold["stage2_not_declared"]) + + def as_dict(self) -> dict[str, Any]: + return { + "params": self.params.as_dict(), + "fp_arm": { + "failed": self.fp_failed, + "passed": self.fp_passed, + "share_failed_of_decided": ( + round(self.fp_failed / (self.fp_failed + self.fp_passed), 6) + if (self.fp_failed + self.fp_passed) + else None + ), + "failed_with_criterion_a_failed": self.fp_failed_with_a_failed, + "loci_decided": self.fp_loci_decided, + "loci_failing_a_and_b": self.fp_loci_failing_a_and_b, + "unit_note": ( + "the candidate counts are manifest rows; the LOCUS counts collapse " + "candidates addressing the same span from overlapping tiling windows. " + "Every FP interval in this report is on the locus." + ), + }, + "round_yield_n_mined": dict(self.mined_by_threshold), + "round_yield_n_mined_loci": dict(self.mined_loci_by_threshold), + "control_arm": dict(self.control), + } + + +def evaluate_point( + params: ParamTuple, + *, + fp_items: Sequence[SupplyItem], + fp_id_by_slug: Mapping[str, str], + by_id: Mapping[str, Mapping[str, Any]], + control_items: Sequence[SupplyItem], + control_id_by_slug: Mapping[str, str], + control_status: Mapping[str, str], + control_record_index: Mapping[str, Sequence[str]], +) -> PointResult | str: + """Both arms at one grid point, or the refusal string if the point is inadmissible.""" + fp_verdicts = sweep_arm(fp_items, params) + if isinstance(fp_verdicts, str): + return fp_verdicts + control_verdicts = sweep_arm(control_items, params) + if isinstance(control_verdicts, str): + return control_verdicts + + arch_by_id = {fp_id_by_slug[slug]: state for slug, state in fp_verdicts.items()} + mined_by_t = { + ("stage2_not_declared" if t is None else f"stage2_threshold_{t}"): mined_ids( + by_id, arch_by_id, stage2_threshold=t + ) + for t in (None, *STAGE2_THRESHOLD_SENSITIVITY) + } + mined = {k: len(v) for k, v in mined_by_t.items()} + mined_loci = {k: len({locus_of(c) for c in v}) for k, v in mined_by_t.items()} + fp_failed = sum(1 for s in fp_verdicts.values() if s == STATUS_FAILED) + failing_a_and_b = [ + cid + for cid, state in arch_by_id.items() + if state == STATUS_FAILED and by_id[cid]["covariation_status"] == STATUS_FAILED + ] + fp_with_a = len(failing_a_and_b) + control_by_query = {control_id_by_slug[s]: v for s, v in control_verdicts.items()} + return PointResult( + params=params, + fp_failed=fp_failed, + fp_passed=len(fp_verdicts) - fp_failed, + fp_failed_with_a_failed=fp_with_a, + fp_loci_decided=len({locus_of(c) for c in arch_by_id}), + fp_loci_failing_a_and_b=len({locus_of(c) for c in failing_a_and_b}), + mined_by_threshold=mined, + mined_loci_by_threshold=mined_loci, + control=control_damage(control_status, control_record_index, control_by_query), + ) + + +# ═════════════════════════════════════════════════════════════════════════════ +# Applying the rule +# ═════════════════════════════════════════════════════════════════════════════ +def floors_passed( + params: ParamTuple, + floors: Sequence[DecisionFloor] = DECISION_FLOORS, +) -> tuple[str, ...]: + """The keys of every floor ``params`` clears.""" + return tuple(f.key for f in floors if f.predicate(params)) + + +def clears_all_floors( + params: ParamTuple, + floors: Sequence[DecisionFloor] = DECISION_FLOORS, +) -> bool: + """The ONLY spelling of "this setting is one the rule may choose". + + ``apply_decision_rule`` filtered with its own inline ``all(f.predicate(...))`` until + a sabotage showed the two could drift: neutering this function left the selection + untouched, which is precisely the state in which the frontier and the recommendation + could disagree about what "clears every floor" means + ([[fixed-one-of-two-identical-things]]). + """ + return len(floors_passed(params, floors)) == len(floors) + + +def _tie_break_key(result: PointResult) -> tuple[Any, ...]: + p = result.params + return (int(p.allow_wobble), p.stem_i_nt_threshold, p.bulge_max_nt) + + +def apply_decision_rule( + results: Sequence[PointResult], + *, + floors: Sequence[DecisionFloor] = DECISION_FLOORS, +) -> dict[str, Any]: + """The rule of :data:`DECISION_RULE_STATEMENT`, applied to the measured grid. + + ``floors`` is a parameter only so :func:`floor_sensitivity` can re-run the *same* + selection with one floor removed. A second copy of the selection there would be a + diagnostic that could disagree with the decision it is describing. + """ + survivors = [r for r in results if clears_all_floors(r.params, floors)] + if not survivors: + raise RecommendError( + "no admissible grid point clears every decision floor; the floors and the " + "shipped axes disagree, which is a decision to take, not a tie to break" + ) + fewest = min(r.fp_failed for r in survivors) + argmin = [r for r in survivors if r.fp_failed == fewest] + ordered = sorted(argmin, key=_tie_break_key) + chosen = ordered[0] + # A tie the TIE_BREAK_ORDER vocabulary cannot speak to means the rule did not decide. + # ⚠ The test is "do the tied settings disagree on a parameter OUTSIDE that vocabulary", + # NOT "do their tie-break keys collide": two settings differing in BOTH min_helix_pairs + # and bulge_max_nt have different keys, so a key comparison separates them by + # bulge_max_nt alone and publishes a min_helix_pairs nobody chose. + # A DIFFERENCE, not a symmetric one: the set wanted is "parameter keys the tie-break + # vocabulary cannot speak to". `^` would also return vocabulary names that are not + # parameter keys, and the lookup below would then raise KeyError inside the very guard + # that exists to stop an undecided selection being published. + undecidable = tuple(sorted(set(chosen.params.as_dict()) - set(TIE_BREAK_VOCABULARY))) + disagreeing = [ + r + for r in ordered[1:] + if any(r.params.as_dict()[k] != chosen.params.as_dict()[k] for k in undecidable) + ] + if disagreeing: + axes = sorted( + { + k + for r in disagreeing + for k in undecidable + if r.params.as_dict()[k] != chosen.params.as_dict()[k] + } + ) + raise RecommendError( + f"the decision rule left {len(disagreeing) + 1} settings tied at the measured " + f"minimum that TIE_BREAK_ORDER cannot separate — they disagree on {axes}: " + f"{[r.params.label for r in [chosen, *disagreeing]]}" + ) + return { + "n_admissible_points": len(results), + "n_clearing_every_floor": len(survivors), + "n_at_the_measured_minimum": len(argmin), + "chosen": chosen, + "tied_with": [r.params.as_dict() for r in ordered[1:]], + } + + +def floor_sensitivity( + results: Sequence[PointResult], + chosen: PointResult, +) -> dict[str, Any]: + """Which floors CHANGE the answer, and which merely rule out an exact tie. + + A floor that never changes the selected tuple is not load-bearing evidence, and a + report that lists four floors as if each earned its place overstates the derivation. + Each floor is dropped **alone** and the rule re-run — the one-at-a-time form, because + dropping them together would only show that the conjunction bites, which is the + weaker claim ([[all-true-fixture-cannot-test-a-conjunction]]). + """ + out: dict[str, Any] = {} + for dropped in DECISION_FLOORS: + kept = [f for f in DECISION_FLOORS if f.key != dropped.key] + try: + alternative = apply_decision_rule(results, floors=kept)["chosen"] + except RecommendError as exc: + # Dropping the floor leaves the rule UNABLE to decide. That is the floor's + # contribution and it must be reported as such — picking whichever tuple the + # grid happened to enumerate first would attribute a decision to the rule + # that the rule refused to make. + out[dropped.key] = { + "selection_without_this_floor": None, + "changes_the_selection": None, + "measured_identically_to_the_chosen_setting": None, + "the_rule_cannot_decide_without_it": str(exc), + } + continue + same_tuple = alternative.params.as_dict() == chosen.params.as_dict() + out[dropped.key] = { + "selection_without_this_floor": alternative.params.as_dict(), + "changes_the_selection": not same_tuple, + # ⚠ null, not True, when the selection did not move: comparing the chosen + # setting with itself is vacuously identical, and a TRUE that cannot be FALSE + # reads in the report as evidence when it is the absence of any + # ([[clauses-must-guard-emptiness]]). + "measured_identically_to_the_chosen_setting": ( + None + if same_tuple + else ( + alternative.fp_failed == chosen.fp_failed + and alternative.control["n_records_losing_a_and_b"] + == chosen.control["n_records_losing_a_and_b"] + and alternative.mined == chosen.mined + ) + ), + } + return out + + +def frontier( + results: Sequence[PointResult], + *, + only_floor_clearing: bool = False, +) -> list[dict[str, Any]]: + """Per achievable yield, the admissible point that costs the fewest control records. + + Reported in full so the reader can see what the rule declines to take. ⚠ These are + argmins over thousands of points against 68 control records: they are what the grid + *contains*, not settings this module recommends. + + ``only_floor_clearing`` restricts the frontier to the region the decision rule is + allowed to choose from. Both are emitted: the unrestricted one is what the grid + offers, and the restricted one is the trade actually on the table — reporting only + the first would advertise yields the rule cannot take, and only the second would + hide the cost of the floors. + """ + best: dict[int, PointResult] = {} + counts: dict[int, int] = {} + for r in results: + if only_floor_clearing and not clears_all_floors(r.params): + continue + counts[r.mined] = counts.get(r.mined, 0) + 1 + incumbent = best.get(r.mined) + if incumbent is None or ( + r.control["n_records_losing_a_and_b"], + _tie_break_key(r), + ) < ( + incumbent.control["n_records_losing_a_and_b"], + _tie_break_key(incumbent), + ): + best[r.mined] = r + return [ + { + "n_mined": n, + "n_admissible_points_at_this_yield": counts[n], + "fewest_control_records_losing_a_and_b": best[n].control["n_records_losing_a_and_b"], + "of_n_producible_records": best[n].control["n_records_producible"], + "ci95": best[n].control["share_records_losing_a_and_b_ci95"], + "clears_every_decision_floor": clears_all_floors(best[n].params), + "example_params": best[n].params.as_dict(), + } + for n in sorted(best) + ] + + +def selection_by_min_named_helices(results: Sequence[PointResult]) -> dict[str, Any]: + """Run the whole rule at every ``min_named_helices`` level, and price each answer. + + ``min_named_helices`` is the one floor whose LEVEL this module cannot derive: D3 + contains no number and delegates the value to the held-out canonical set at P6, and + two readings of its wording are supported in this repo — plural (>= 2) and the + canonical class-I core (>= 3), the latter stated by the shipped localizer's own + docstring. The level therefore belongs to the §7 decision, and presenting only one + of them as "the derivation" would be this module choosing it by omission. + """ + out: list[dict[str, Any]] = [] + for level in MIN_NAMED_HELICES_LEVELS: + floors = tuple( + ( + DecisionFloor( + key=f"min_named_helices >= {level}", + predicate=(lambda lvl: lambda p: p.min_named_helices >= lvl)(level), + rationale=f.rationale, + source=f.source, + ) + if f.key.startswith("min_named_helices") + else f + ) + for f in DECISION_FLOORS + ) + row: dict[str, Any] = { + "min_named_helices": level, + "reading": MIN_NAMED_HELICES_READINGS.get(level), + } + try: + picked: PointResult = apply_decision_rule(results, floors=floors)["chosen"] + except RecommendError as exc: + row["selection"] = None + row["the_rule_cannot_decide_at_this_level"] = str(exc) + out.append(row) + continue + row.update( + { + "selection": picked.params.as_dict(), + "matches_named_setting": next( + (t.label for t in default_tuples() if t.as_dict() == picked.params.as_dict()), + None, + ), + "round_yield_n_mined": picked.mined, + "control_records_losing_a_and_b": picked.control["n_records_losing_a_and_b"], + "of_n_producible_records": picked.control["n_records_producible"], + "fp_arm_failed_of_decided": ( + f"{picked.fp_failed}/{picked.fp_failed + picked.fp_passed}" + ), + } + ) + out.append(row) + return { + "why_this_block_exists": ( + "the recommendation below is the level-2 row. ADR-0006 D3 assigns this value to " + "the held-out canonical set at P6 and states no number, so choosing the level " + "is a CLAUDE.md §7 decision and every level is priced here rather than one " + "being presented as derived." + ), + "levels": out, + } + + +def bulge_sentinel_comparison( + results: Sequence[PointResult], + chosen: PointResult, +) -> dict[str, Any]: + """The chosen setting against its own ``bulge_max_nt = 10000`` twin, measured. + + The bounded-bulge floor's rationale asserts that keeping the bound costs nothing. + That is a claim about two specific settings, and it was originally cross-referenced to + :func:`floor_sensitivity`, whose identity field is ``null`` exactly when the floor does + not move the selection — i.e. the citation pointed at the one case where the field + cannot carry it ([[pinned-constant-that-nothing-reads]]). This function measures the + pair directly, so the rationale cites evidence that exists. + """ + twin_params = {**chosen.params.as_dict(), "bulge_max_nt": BULGE_MAX_UNBOUNDED} + twin = next((r for r in results if r.params.as_dict() == twin_params), None) + if twin is None: + return { + "sentinel_twin_admissible": False, + "why": ( + "the chosen setting's bulge_max_nt = 10000 twin is not an admissible grid " + "point, so the bounded value cannot be compared against it here" + ), + } + return { + "sentinel_twin_admissible": True, + "chosen_bulge_max_nt": chosen.params.bulge_max_nt, + "sentinel_bulge_max_nt": BULGE_MAX_UNBOUNDED, + "measures_identically": bool( + twin.fp_failed == chosen.fp_failed + and twin.mined == chosen.mined + and twin.control["n_records_losing_a_and_b"] + == chosen.control["n_records_losing_a_and_b"] + and twin.control["n_records_losing_b"] == chosen.control["n_records_losing_b"] + ), + "chosen": { + "fp_failed": chosen.fp_failed, + "n_mined": chosen.mined, + "control_records_losing_a_and_b": chosen.control["n_records_losing_a_and_b"], + }, + "sentinel_twin": { + "fp_failed": twin.fp_failed, + "n_mined": twin.mined, + "control_records_losing_a_and_b": twin.control["n_records_losing_a_and_b"], + }, + } + + +def tie_break_exercised(results: Sequence[PointResult]) -> dict[str, Any]: + """Which TIE_BREAK_ORDER entries can fire on the grid that was actually swept. + + A reader auditing the derivation would otherwise take three entries for three + exercised safeguards. An axis the enumeration holds at one value cannot break + anything, and saying so is cheaper than letting the list imply otherwise. + """ + axes = { + name: sorted({r.params.as_dict()[name] for r in results}) for name, _ in TIE_BREAK_ORDER + } + return { + "values_present_on_the_swept_grid": axes, + "can_fire": {name: len(values) > 1 for name, values in axes.items()}, + "note": ( + "an entry over a single-valued axis is inert here by construction, not by " + "measurement of the arms; it is kept so a supply that DID vary that axis would " + "still be resolved by a stated preference rather than by sort order." + ), + } + + +def dominating_alternatives( + results: Sequence[PointResult], + chosen: PointResult, +) -> dict[str, Any]: + """Floor-clearing settings that mine MORE at no greater measured control cost. + + The rule selects on permissiveness, not on yield, so it will walk past settings that + look strictly better on this pair of measurements. Those settings are enumerated + here rather than left for a reader to find: a recommendation that quietly declines a + dominating alternative is asking to be trusted instead of checked. + + ⚠ "Dominating" is on **two measured coordinates over the whole admissible grid + against a few dozen control records**, and the damage coordinate omits (c) entirely. + A setting that dominates here is a candidate for being *fitted*, not for being right — + which is the whole reason the rule is stated before the counts are read. + """ + better = [ + r + for r in results + if clears_all_floors(r.params) + and r.mined > chosen.mined + and r.control["n_records_losing_a_and_b"] <= chosen.control["n_records_losing_a_and_b"] + ] + by_yield: dict[int, PointResult] = {} + for r in better: + incumbent = by_yield.get(r.mined) + if incumbent is None or _tie_break_key(r) < _tie_break_key(incumbent): + by_yield[r.mined] = r + return { + "n_settings": len(better), + "max_extra_mined": (max(r.mined for r in better) - chosen.mined) if better else 0, + "examples_by_yield": [ + { + "params": by_yield[n].params.as_dict(), + "n_mined": n, + "n_extra_mined_vs_recommendation": n - chosen.mined, + "control_records_losing_a_and_b": by_yield[n].control["n_records_losing_a_and_b"], + "of_n_producible_records": by_yield[n].control["n_records_producible"], + } + for n in sorted(by_yield) + ], + "why_the_rule_declines_them": ( + "they are selected BY the two arms, on a few dozen control records, from " + "thousands of grid points (the counts live in grid.n_admissible, yield_ceiling " + "and control_arm.n_records_producible, never in this sentence); the extra " + "yield is a handful of candidates; and the damage coordinate excludes (c), " + "which is the only disjunct with measured discrimination. ADR-0006 A4 asks the " + "round to supply a chosen value and record it — taking one of these would " + "record a tuned one instead, and nothing downstream would say so." + ), + } + + +def assert_supply_is_the_decided_set( + label: str, + supply_ids: Iterable[str], + status: Mapping[str, str], +) -> None: + """The consensuses on disk must be **exactly** the ids criterion (a) decided. + + A size comparison would pass on two sets of the same cardinality that overlap + partially, and every count downstream would still reconcile — the report would be + internally flawless and about a different corpus + ([[gate-must-bind-to-upstream-evidence]]). A candidate present in the supply but + ``unavailable`` in the status table, or decided in the table with no consensus on + disk, is a producer/retrieval mismatch and is refused rather than defaulted. + """ + decided = {cid for cid, state in status.items() if state in DECIDED_STATES} + # ⚠ Counted BEFORE the set: `set(...)` would merge a repeated id, and the equality + # below would then hold on a supply carrying two consensuses for one candidate while + # `n_consensuses` and every per-item loop still saw both rows + # ([[duplicate-key-merges-instead-of-colliding]]). Neither shipped call site can + # produce one today — both derive their ids from a slug→id index over unique + # directories — so this refuses a shape the contract forbids rather than one observed. + ids = list(supply_ids) + have = set(ids) + if len(ids) != len(have): + repeated = sorted({cid for cid in have if ids.count(cid) > 1}) + raise RecommendError( + f"the {label} supply names {len(ids) - len(have)} candidate id(s) more than " + f"once (e.g. {repeated[:2]}); one candidate cannot have two consensuses" + ) + if decided == have: + return + missing, extra = sorted(decided - have), sorted(have - decided) + raise RecommendError( + f"the {label} supply is not criterion (a)'s decided set: {len(missing)} decided " + f"with no consensus on disk (e.g. {missing[:2]}), {len(extra)} consensuses whose " + f"candidate (a) did not decide (e.g. {extra[:2]})" + ) + + +def read_json_object(path: str | Path, what: str) -> dict[str, Any]: + """One operator-supplied JSON file, read as an OBJECT or refused. + + Every report path on this CLI is an operator argument, and ``json.loads`` returns + whatever the file holds. A bare ``.get`` on a list, a string or ``null`` raises + ``AttributeError`` — outside ``main``'s ``(RecommendError, ValueError, TypeError, + OSError, KeyError)`` — so the CLI died in a traceback where it should have refused. + """ + try: + payload = json.loads(Path(path).read_text(encoding="utf-8")) + except (OSError, ValueError) as exc: + raise RecommendError(f"{portable_path(path)}: cannot read {what} ({exc})") from exc + if not isinstance(payload, Mapping): + raise RecommendError(f"{portable_path(path)}: {what} must be a JSON object") + return dict(payload) + + +def object_field(payload: Mapping[str, Any], key: str, where: str) -> dict[str, Any]: + """``payload[key]`` as a mapping — ABSENT is ``{}``, PRESENT-but-not-an-object refuses. + + ``payload.get(key, {})`` and ``payload.get(key) or {}`` both substitute the default + only for an absent (or falsy) value: a *truthy* non-mapping sails through and the next + ``.get`` raises ``AttributeError``. Absent stays permissive because several of these + blocks are genuinely optional; a wrong *shape* is a malformed file and is named. + """ + value = payload.get(key) + if value is None: + return {} + if not isinstance(value, Mapping): + raise RecommendError(f"{where}: '{key}' is {type(value).__name__}, expected an object") + return dict(value) + + +def index_by_slug(label: str, msa_root: str | Path, ids: Iterable[str]) -> dict[str, str]: + """``slug → candidate_id`` for one arm, built so a collision is REFUSED, not merged. + + Written as a dict comprehension, two ids landing on one slug kept only the last: the + consensus measured for that slug would be attributed to one candidate and the other + would leave ``arch_by_id`` silently, with every yield count still reconciling — the + exact shape this module refuses for manifest ids and for supply ids + ([[duplicate-key-merges-instead-of-colliding]]). The orphan check downstream cannot + see it: it only finds slugs with *no* candidate. + + ⚠ Two DISTINCT ids cannot collide by construction — ``covariation_producer. + candidate_slug`` appends a 12-hex digest of the exact id for that reason — so the + reachable trigger is a repeated id, and that is what the test builds. + """ + index: dict[str, str] = {} + for cid in ids: + slug = candidate_msa_path(msa_root, cid).parent.name + if slug in index: + raise RecommendError( + f"the {label} slug {slug!r} is claimed by two candidate ids " + f"({index[slug]!r} and {cid!r}); merging them would attribute one " + "consensus to one of the two and drop the other with every count " + "still reconciling" + ) + index[slug] = cid + return index + + +def assert_comparison_describes_these_supplies( + comparison: Any, + fp_digest: str, + control_digest: str, +) -> None: + """The carried-forward headline must be about the supplies this run measured. + + ``arms.comparison_headline_carried_forward`` copies a sentence out of + ``architecture_parameter_control_comparison.json`` — a *reading* of the two arms — and + the file's provenance hash identifies the file, not its subject. Both measurement + reports are already bound to the supplies by digest here; the comparison was not, so a + stale one could inject a headline about a different pair of arms into a report whose + every other number came from these two ([[gate-must-bind-to-upstream-evidence]]). + + ⚠ Refused when the digests are ABSENT as well as when they disagree: a comparison + report that records no digest binds nothing, and reading the field as "no disagreement + found" is the vacuous-TRUE this project keeps meeting ([[clauses-must-guard-emptiness]]). + """ + arms = comparison.get("arms") if isinstance(comparison, Mapping) else None + if not isinstance(arms, Mapping): + raise RecommendError( + "the comparison report carries no 'arms' block, so its headline cannot be " + "bound to these supplies" + ) + for label, key, digest in (("FP", "fp", fp_digest), ("control", "control", control_digest)): + arm = arms.get(key) + recorded = arm.get("supply_digest_sha256") if isinstance(arm, Mapping) else None + if recorded != digest: + raise RecommendError( + f"the comparison report's {label} arm records supply digest {recorded} but " + f"the supply measured here digests to {digest} — its headline is a reading " + "of different arms" + ) + + +def checked_origin(label: str, origin: Any) -> str | None: + """A supply origin copied out of another report clears the same guard as the flag. + + ``--supply-origin`` is refused when it looks like a local absolute path, because this + report is public. The two origins carried forward from the measurement reports reached + the payload without that check — a second route to the same leak, because the guard sat + on the argument rather than on the field ([[fixed-one-of-two-identical-things]]). + """ + if origin is None: + return None + text = str(origin) + if is_local_path_shaped(text): + raise RecommendError( + f"the {label} measurement report's supply_origin looks like a local absolute " + f"path ({text!r}); this report is public and will not carry it forward" + ) + return text + + +def anti_selectivity(result: PointResult) -> dict[str, Any]: + """Does the (a)∧(b) conjunction fall through MORE often on known T-boxes? + + (b)'s own failure share is what the two measurement reports compare, but the object + that decides what is mined is the **conjunction**: a candidate reaches mining only + with (a) failed too. If the conjunction falls through more often on the control than + on the FP arm, the composite is selecting *against* the class it exists to protect — + which the per-criterion comparison cannot show. + + ⚠ **Both arms are stated on their INDEPENDENT unit, and this is a correction.** An + earlier form of this function put a query-level binomial interval on the control — the + very interval :func:`control_damage` refuses to publish — against a candidate-level one + on the FP arm, and reported the two "disjoint" at the strictest settings. Neither unit + was independent: the control's queries share records, and 79 of the FP arm's 278 + decided candidates are second calls on a locus already counted. Restated on records + (n = 68) against loci (n = 199), **no setting on the named grid has disjoint + intervals**. The direction survives; the separation does not, and the two are + different claims. + """ + ctrl_k = result.control["n_records_losing_a_and_b"] + ctrl_n = result.control["n_records_producible"] + fp_k = result.fp_loci_failing_a_and_b + fp_n = result.fp_loci_decided + ctrl_lo, ctrl_hi = wilson_interval(ctrl_k, ctrl_n) if ctrl_n else (None, None) + fp_lo, fp_hi = wilson_interval(fp_k, fp_n) if fp_n else (None, None) + ctrl_share = ctrl_k / ctrl_n if ctrl_n else None + fp_share = fp_k / fp_n if fp_n else None + return { + "unit": "control = producible RECORDS; FP arm = decided LOCI", + "control_records_failing_a_and_b": f"{ctrl_k}/{ctrl_n}", + "control_share": None if ctrl_share is None else round(ctrl_share, 6), + "control_ci95": None if ctrl_lo is None else [round(ctrl_lo, 6), round(ctrl_hi, 6)], + "fp_loci_failing_a_and_b": f"{fp_k}/{fp_n}", + "fp_share": None if fp_share is None else round(fp_share, 6), + "fp_ci95": None if fp_lo is None else [round(fp_lo, 6), round(fp_hi, 6)], + "fp_minus_control_pp": ( + None + if ctrl_share is None or fp_share is None + else round(100 * (fp_share - ctrl_share), 4) + ), + "control_falls_through_more": ( + None if ctrl_share is None or fp_share is None else bool(ctrl_share > fp_share) + ), + "intervals_disjoint": ( + None if ctrl_lo is None or fp_lo is None else bool(ctrl_lo > fp_hi or fp_lo > ctrl_hi) + ), + "also_at_the_row_level_for_reference": { + "control_queries_failing_a_and_b": ( + f"{result.control['n_queries_a_and_b_failed']}/" + f"{result.control['n_queries_decided']}" + ), + "fp_candidates_failing_a_and_b": ( + f"{result.fp_failed_with_a_failed}/{result.fp_failed + result.fp_passed}" + ), + "no_interval_because": ( + "neither row unit is independent — control queries share records and FP " + "candidates share loci — so these are point counts only" + ), + }, + "what_disjointness_would_and_would_not_mean": ( + "non-overlapping Wilson intervals are a CONSERVATIVE indication of a " + "difference, not a test of one; overlapping intervals do not establish " + "equality either. Read the direction and the size, not the flag." + ), + } + + +# ═════════════════════════════════════════════════════════════════════════════ +# The report +# ═════════════════════════════════════════════════════════════════════════════ +def recommend( + *, + fp_msa_root: str | Path, + control_msa_root: str | Path, + fp_manifest_path: str | Path, + spare_rule_inputs_path: str | Path, + control_status_path: str | Path, + control_manifest_path: str | Path, + fp_report_path: str | Path, + control_report_path: str | Path, + comparison_report_path: str | Path, + supply_origin: str | None = None, +) -> dict[str, Any]: + """The whole re-derivation, as the report body.""" + if supply_origin is not None and is_local_path_shaped(supply_origin): + raise RecommendError( + f"--supply-origin {supply_origin!r} looks like a local absolute path; this " + "report is public — name the cluster origin, not a home directory" + ) + fp_items = read_supply(fp_msa_root) + control_items = read_supply(control_msa_root) + fp_digest = supply_digest(fp_items) + control_digest = supply_digest(control_items) + + # The supplies are cluster-only, so bind them to the committed reports by digest: + # a re-run against a different round directory of the same cardinality would + # otherwise produce a tidy table about the wrong corpus. + fp_report_where = portable_path(fp_report_path) + control_report_where = portable_path(control_report_path) + comparison_where = portable_path(comparison_report_path) + fp_report = read_json_object(fp_report_path, "the FP measurement report") + control_report = read_json_object(control_report_path, "the control measurement report") + comparison = read_json_object(comparison_report_path, "the comparison report") + for label, report, digest, where in ( + ("FP", fp_report, fp_digest, fp_report_where), + ("control", control_report, control_digest, control_report_where), + ): + recorded = object_field(report, "supply", where).get("supply_digest_sha256") + if recorded != digest: + raise RecommendError( + f"the {label} supply on disk digests to {digest} but the committed " + f"report records {recorded} — this is a different supply" + ) + assert_comparison_describes_these_supplies(comparison, fp_digest, control_digest) + + manifest_ids = read_manifest_ids(fp_manifest_path) + inputs = load_spare_rule_inputs(spare_rule_inputs_path) + by_id: dict[str, Any] = inputs["by_id"] + assert_covers_manifest(by_id, manifest_ids) + + fp_id_by_slug = index_by_slug("FP", fp_msa_root, manifest_ids) + # ⚠ Shape-checked HERE, not in `control_records`: `index_by_slug` consumes this value + # twelve lines before that function's own `isinstance(status, Mapping)` refusal can + # fire, so a mis-shaped table used to be diagnosed by whatever the slug walk produced + # ([[guard-runs-after-what-it-guards]]). + control_status = object_field( + read_json_object(control_status_path, "the control status table"), + "status", + portable_path(control_status_path), + ) + if not control_status: + raise RecommendError( + f"{portable_path(control_status_path)}: the control status table carries no " + "'status' map, so no control query is scored" + ) + control_id_by_slug = index_by_slug("control", control_msa_root, control_status) + for label, items, index in ( + ("FP", fp_items, fp_id_by_slug), + ("control", control_items, control_id_by_slug), + ): + orphans = sorted(i.slug for i in items if i.slug not in index) + if orphans: + raise RecommendError( + f"{len(orphans)} {label} consensus slug(s) resolve to no manifest " + f"candidate, e.g. {orphans[:2]}; the supply and the manifest disagree" + ) + ids_with_consensus = [fp_id_by_slug[i.slug] for i in fp_items] + control_record_index = control_records( + control_status, control_manifest_path, status_path=control_status_path + ) + assert_supply_is_the_decided_set( + "FP", + ids_with_consensus, + {cid: str(row["covariation_status"]) for cid, row in by_id.items()}, + ) + assert_supply_is_the_decided_set( + "control", + (control_id_by_slug[i.slug] for i in control_items), + control_status, + ) + + admissible: list[PointResult] = [] + refusals: dict[str, int] = {} + for params in grid_points(): + outcome = evaluate_point( + params, + fp_items=fp_items, + fp_id_by_slug=fp_id_by_slug, + by_id=by_id, + control_items=control_items, + control_id_by_slug=control_id_by_slug, + control_status=control_status, + control_record_index=control_record_index, + ) + if isinstance(outcome, str): + reason = outcome.split(":", 1)[0] + refusals[reason] = refusals.get(reason, 0) + 1 + continue + admissible.append(outcome) + if not admissible: + raise RecommendError("the shipped localizer refused every grid point") + + decision = apply_decision_rule(admissible) + chosen: PointResult = decision["chosen"] + by_params = {tuple(sorted(r.params.as_dict().items())): r for r in admissible} + named: list[dict[str, Any]] = [] + for tup in default_tuples(): + key = tuple(sorted(tup.as_dict().items())) + result = by_params.get(key) + if result is None: # pragma: no cover - the named six are all admissible + continue + named.append( + { + "label": tup.label, + "clears_every_decision_floor": clears_all_floors(tup), + "floors_cleared": list(floors_passed(tup)), + **result.as_dict(), + "anti_selectivity": anti_selectivity(result), + } + ) + + ceiling = yield_ceiling(by_id, ids_with_consensus=ids_with_consensus) + chosen_verdicts = sweep_arm(fp_items, chosen.params) + if isinstance(chosen_verdicts, str): # pragma: no cover - it was admissible above + raise RecommendError( + f"the chosen setting became inadmissible on re-evaluation: {chosen_verdicts}" + ) + chosen_mined = mined_ids( + by_id, + {fp_id_by_slug[slug]: state for slug, state in chosen_verdicts.items()}, + stage2_threshold=None, + ) + return { + "adr": ADR, + "step": STEP, + "schema_version": SCHEMA_VERSION, + "pins_nothing": True, + "disclosure": ( + "This report RECOMMENDS criterion (b)'s seven ADR-0006 A4 rule parameters and " + "pins none of them. The value is a CLAUDE.md §7 decision for the project lead; " + "it enters the round through the producer's seven required exports and is " + "recorded in that round's provenance, per A4. D6/D17's P6 threshold freeze is " + "untouched, and no ADR is amended by this step." + ), + "decision_rule": { + "statement": DECISION_RULE_STATEMENT, + "floors": [f.as_dict() for f in DECISION_FLOORS], + "tie_break_order": [{"parameter": k, "resolves_to": v} for k, v in TIE_BREAK_ORDER], + }, + "arms": { + "fp": { + "step": "P3-15'-f", + "n_consensuses": len(fp_items), + "supply_digest_sha256": fp_digest, + "supply_origin": checked_origin( + "fp", object_field(fp_report, "supply", fp_report_where).get("supply_origin") + ), + "ground_truth": ( + "unknown — a round-0 false-positive MANIFEST, not verified negatives" + ), + }, + "control": { + "step": "P3-15'-g-iv", + "n_consensuses": len(control_items), + "supply_digest_sha256": control_digest, + "supply_origin": checked_origin( + "control", + object_field(control_report, "supply", control_report_where).get( + "supply_origin" + ), + ), + "ground_truth": ( + "believed positive — held-out curated TBDB records, Stage-1 re-detected" + ), + }, + "comparison_headline_carried_forward": object_field( + comparison, "headline", comparison_where + ).get("reading"), + }, + "grid": { + "n_points_enumerated": len(grid_points()), + "n_admissible": len(admissible), + "n_refused_by_the_shipped_localizer": sum(refusals.values()), + "refusal_reasons": dict(sorted(refusals.items())), + "axes": { + "min_named_helices": list(MIN_NAMED_HELICES_SWEEP), + "min_helix_pairs": list(MIN_HELIX_PAIRS_SWEEP), + "bulge_min_nt": list(BULGE_MIN_NT_SWEEP), + "bulge_max_nt": list(BULGE_MAX_NT_SWEEP), + "ncca_pairing_nt": list(NCCA_PAIRING_NT_SWEEP), + "allow_wobble": [False, True], + }, + "note": ( + "admissibility is MEASURED by running the shipped localizer, not by " + "re-encoding its guards: it refuses any setting whose bulge size floor is " + "shorter than its NCCA register." + ), + }, + "yield_ceiling": ceiling, + "named_settings": named, + "frontier_all_admissible": frontier(admissible), + "frontier_clearing_every_floor": frontier(admissible, only_floor_clearing=True), + "recommendation": { + "params": chosen.params.as_dict(), + "mined_candidate_ids": chosen_mined, + "matches_named_setting": next( + (t.label for t in default_tuples() if t.as_dict() == chosen.params.as_dict()), + None, + ), + "n_admissible_points": decision["n_admissible_points"], + "n_clearing_every_floor": decision["n_clearing_every_floor"], + "n_at_the_measured_minimum": decision["n_at_the_measured_minimum"], + "tied_with": decision["tied_with"], + "floor_sensitivity": floor_sensitivity(admissible, chosen), + "bulge_sentinel_comparison": bulge_sentinel_comparison(admissible, chosen), + "selection_by_min_named_helices": selection_by_min_named_helices(admissible), + "tie_break_exercised": tie_break_exercised(admissible), + "helix_stack_depth_evidence": { + "source": "helix_arm.helix_stack_depth of each arm's measurement report", + "fp_arm": object_field(fp_report, "helix_arm", fp_report_where).get( + "helix_stack_depth" + ), + "control_arm": object_field(control_report, "helix_arm", control_report_where).get( + "helix_stack_depth" + ), + "why_it_is_here": ( + "the min_helix_pairs floor's rationale makes an empirical claim about " + "stack depth; the distribution it appeals to is carried here so the " + "claim is checkable inside the artifact that makes it" + ), + }, + "dominating_alternatives": dominating_alternatives(admissible, chosen), + "measured": chosen.as_dict(), + "anti_selectivity": anti_selectivity(chosen), + "what_it_costs": ( + "the frontier above shows what a higher-yield setting would buy and what it " + "would cost in control records; the rule declines those because selecting " + "them is fitting a value to a few dozen records, not choosing one." + ), + }, + "limitations": { + "the_fp_arm_is_not_a_verified_negative_set": ( + "it is a false-positive MANIFEST of unknown status. If a material share of " + "it is really T-box, the two arms are not two populations and the " + "anti-selectivity reading weakens accordingly." + ), + "criterion_c_is_unmeasured_on_the_control": ( + "the control's hosts carry no annotation, so every control damage figure " + "omits the one criterion with measured discrimination and is an upper bound." + ), + "the_grid_is_not_the_parameter_space": ( + "the axes are the two measurement reports' sweep; a value off those axes is " + "unmeasured here, and stem_i_nt_threshold is swept at one value because it " + "is proved inert on both manifests." + ), + "the_control_is_68_records": ( + "adjacent grid points differing by a few candidates are not distinguishable " + "at this n; the frontier is reported as what the grid contains, not as a " + "ranking." + ), + "stage2_threshold_is_unpinned": ceiling["stage2_threshold_note"], + }, + } + + +def anchor_of( + path: str | Path, + report_path: str | Path, + keys: Sequence[str], + *, + list_name: str | None = None, +) -> str | None: + """Say a digest is anchored **only after checking**, and name the miss otherwise. + + These strings are a provenance claim: "some committed report vouches for this file". + Written as unconditional constants they would keep asserting it after the file + changed, which is the fabricated-provenance failure ADR-work is meant to make + impossible ([[a-pinned-constant-nothing-reads]]). + """ + digest = sha256_of(path) + try: + payload: Any = json.loads(Path(report_path).read_text(encoding="utf-8")) + except (OSError, ValueError): + return None + for key in keys: + if not isinstance(payload, Mapping) or key not in payload: + return None + payload = payload[key] + if list_name is not None: + entries = payload if isinstance(payload, list) else [] + recorded = next( + ( + e.get("sha256") + for e in entries + if isinstance(e, Mapping) and e.get("name") == list_name + ), + None, + ) + else: + recorded = payload + if recorded != digest: + return None + return f"{portable_path(report_path)} records this exact digest (verified on write)" + + +def build_inputs( + *, + covariation_status_path: str | Path, + synteny_status_path: str | Path, + stage2_posteriors_path: str | Path, + fp_manifest_path: str | Path, +) -> dict[str, Any]: + """Join the three per-candidate spare-rule columns into one committable table. + + All three producers write to cluster scratch or to a working directory; none of them + is in git. The yield arithmetic this step turns on must be auditable without cluster + access, so the join is committed — the same reason `P3-15′-g-iv` committed + ``curated_control_status_v0.json``. + """ + manifest_ids = read_manifest_ids(fp_manifest_path) + assert_manifest_ids_distinct(manifest_ids) + cov = json.loads(Path(covariation_status_path).read_text(encoding="utf-8"))["status"] + syn = json.loads(Path(synteny_status_path).read_text(encoding="utf-8"))["status"] + post = json.loads(Path(stage2_posteriors_path).read_text(encoding="utf-8"))["posteriors"] + for label, table in (("covariation", cov), ("synteny", syn), ("stage2", post)): + missing = [cid for cid in manifest_ids if cid not in table] + if missing: + raise RecommendError( + f"the {label} table is missing {len(missing)} manifest candidate(s), " + f"e.g. {missing[:2]}" + ) + extra = sorted(set(table) - set(manifest_ids)) + if extra: + raise RecommendError( + f"the {label} table carries {len(extra)} id(s) absent from the manifest, " + f"e.g. {extra[:2]}" + ) + rows = [ + { + "candidate_id": cid, + "covariation_status": checked_status( + portable_path(covariation_status_path), cid, "covariation_status", cov[cid] + ), + "synteny_status": checked_status( + portable_path(synteny_status_path), cid, "synteny_status", syn[cid] + ), + "stage2_posterior": checked_posterior( + portable_path(stage2_posteriors_path), cid, post[cid] + ), + } + for cid in sorted(manifest_ids) + ] + return { + "step": STEP, + "schema_version": SCHEMA_VERSION, + "adr": ADR, + "n_candidates": len(rows), + "rows": rows, + "sources": { + "covariation_status": { + "sha256": sha256_of(covariation_status_path), + "origin": "two.amlab:$HOME/tbox-scratch/round_p3_15_supply/covariation_status.json", + "produced_by": "P3-15'-e / -e-ii (SLURM jobs 1205 + 1254)", + "anchored_by": anchor_of( + covariation_status_path, + "reports/p3/architecture_parameter_measurement.json", + ("provenance", "extra", "external_inputs", "covariation_status", "sha256"), + ), + }, + "synteny_status": { + "sha256": sha256_of(synteny_status_path), + "origin": "LOCAL — tbox_finder.mining.synteny_producer (P3-15'-c-ii)", + "produced_by": "P3-15'-c-ii", + "anchored_by": anchor_of( + synteny_status_path, + "reports/p3/synteny_exclusion_diagnostic.json", + ("provenance", "extra", "external_inputs"), + list_name="synteny_status.json", + ), + }, + "stage2_posteriors": { + "sha256": sha256_of(stage2_posteriors_path), + "origin": "two.amlab:$HOME/tbox-scratch/round_p3_15b/stage2_posteriors.json", + "produced_by": "P3-15'-b", + "anchored_by": None, + "warning": ( + "⚠ NO committed report records this digest, and a second scoring of the " + "same 941 candidates exists whose posteriors differ by up to 3.8e-2 (a " + "CUDA forward is not bit-reproducible). The two agree on every candidate " + "at thresholds 0.5 / 0.9 / 0.95 and disagree on 3 at 0.99. This column is " + "therefore carried as a SENSITIVITY only; no headline number rests on it." + ), + }, + }, + } + + +# ═════════════════════════════════════════════════════════════════════════════ +# CLI +# ═════════════════════════════════════════════════════════════════════════════ +def build_parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser( + prog="architecture_param_recommend", + description=( + "Re-derive criterion (b)'s seven ADR-0006 A4 rule parameters over the whole " + "admissible grid, against the matched positive control and the round's real " + "spare-rule conjunction. Pins nothing." + ), + ) + sub = parser.add_subparsers(dest="command", required=True) + + b = sub.add_parser("build-inputs", help="join the three spare-rule columns") + b.add_argument("--covariation-status", required=True) + b.add_argument("--synteny-status", required=True) + b.add_argument("--stage2-posteriors", required=True) + b.add_argument("--fp-manifest", default="data/processed/mining/round0_fp_manifest.json") + b.add_argument("--out", default="data/processed/mining/round0_fp_spare_rule_inputs_v0.json") + + r = sub.add_parser("recommend", help="write the recommendation report") + r.add_argument("--fp-msa-root", required=True) + r.add_argument("--control-msa-root", required=True) + r.add_argument("--fp-manifest", default="data/processed/mining/round0_fp_manifest.json") + r.add_argument( + "--spare-rule-inputs", + default="data/processed/mining/round0_fp_spare_rule_inputs_v0.json", + ) + r.add_argument( + "--control-status", default="data/processed/mining/curated_control_status_v0.json" + ) + r.add_argument( + "--control-manifest", default="data/processed/mining/curated_control_manifest_v0.json" + ) + r.add_argument("--fp-report", default="reports/p3/architecture_parameter_measurement.json") + r.add_argument( + "--control-report", + default="reports/p3/architecture_parameter_measurement_control.json", + ) + r.add_argument( + "--comparison-report", + default="reports/p3/architecture_parameter_control_comparison.json", + ) + r.add_argument("--supply-origin", default=None) + r.add_argument("--out", default="reports/p3/architecture_parameter_recommendation.json") + return parser + + +def _write(body: Mapping[str, Any], out_path: str | Path) -> None: + out = Path(out_path) + out.parent.mkdir(parents=True, exist_ok=True) + out.write_text(json.dumps(body, indent=2, sort_keys=True) + "\n", encoding="utf-8") + + +def main(argv: Sequence[str] | None = None) -> int: + args = build_parser().parse_args(argv) + try: + if args.command == "build-inputs": + body: dict[str, Any] = build_inputs( + covariation_status_path=args.covariation_status, + synteny_status_path=args.synteny_status, + stage2_posteriors_path=args.stage2_posteriors, + fp_manifest_path=args.fp_manifest, + ) + _write(body, args.out) + print(f"joined {body['n_candidates']} spare-rule input rows -> {args.out}") + return 0 + body = recommend( + fp_msa_root=args.fp_msa_root, + control_msa_root=args.control_msa_root, + fp_manifest_path=args.fp_manifest, + spare_rule_inputs_path=args.spare_rule_inputs, + control_status_path=args.control_status, + control_manifest_path=args.control_manifest, + fp_report_path=args.fp_report, + control_report_path=args.control_report, + comparison_report_path=args.comparison_report, + supply_origin=args.supply_origin, + ) + except (RecommendError, ValueError, TypeError, OSError, KeyError) as exc: + print(f"refused: {exc}", file=sys.stderr) + return 3 + try: + repo_inputs: list[str] = [] + external: dict[str, Any] = { + "fp_msa_root": portable_path(args.fp_msa_root), + "control_msa_root": portable_path(args.control_msa_root), + "supply_origin": args.supply_origin, + "fp_supply_digest_sha256": body["arms"]["fp"]["supply_digest_sha256"], + "control_supply_digest_sha256": body["arms"]["control"]["supply_digest_sha256"], + } + for label, candidate in ( + ("fp_manifest", args.fp_manifest), + ("spare_rule_inputs", args.spare_rule_inputs), + ("control_status", args.control_status), + ("control_manifest", args.control_manifest), + ("fp_report", args.fp_report), + ("control_report", args.control_report), + ("comparison_report", args.comparison_report), + ): + if not candidate or not Path(candidate).is_file(): + continue + if is_inside_repo(candidate): + repo_inputs.append(portable_path(candidate)) + else: + external[label] = {"name": Path(candidate).name, "sha256": sha256_of(candidate)} + body["provenance"] = build_provenance( + rule="P3-15'-f criterion-(b) parameter re-derivation", + script=portable_path(__file__), + inputs=sorted(repo_inputs), + outputs=[], + adr=ADR, + extra={"schema_version": SCHEMA_VERSION, "external_inputs": external}, + ) + except (RecommendError, ValueError, TypeError, OSError, KeyError) as exc: + print(f"refused: {exc}", file=sys.stderr) + return 3 + try: + _write(body, args.out) + except OSError as exc: + print(f"refused: cannot write report to {portable_path(args.out)}: {exc}", file=sys.stderr) + return 3 + rec = body["recommendation"] + ceiling = body["yield_ceiling"]["by_stage2_threshold"]["stage2_not_declared"] + print( + f"{body['grid']['n_admissible']} admissible grid points; " + f"{rec['n_clearing_every_floor']} clear every floor; recommendation " + f"{rec['matches_named_setting'] or rec['params']} mines " + f"{rec['measured']['round_yield_n_mined']['stage2_not_declared']} of a ceiling of " + f"{ceiling['max_mined_if_b_failed_everywhere']} -> {args.out}" + ) + return 0 + + +if __name__ == "__main__": # pragma: no cover + raise SystemExit(main()) diff --git a/tests/unit/test_architecture_param_recommend.py b/tests/unit/test_architecture_param_recommend.py new file mode 100644 index 00000000..a7be050b --- /dev/null +++ b/tests/unit/test_architecture_param_recommend.py @@ -0,0 +1,1757 @@ +"""Unit tests for the P3-15'-f criterion-(b) parameter re-derivation. + +Four properties carry this file: + +* **the conjunction is broken one member at a time** — a fixture where every disjunct + fails satisfies "mined" no matter which member the code forgot to read, so each of + the four is flipped ALONE ([[all-true-fixture-cannot-test-a-conjunction]]); +* **the decision rule is tested as a rule, not as its answer** — pinning + ``sensitive_core`` would stay green under a rule that returns a constant, so the + floors are asserted by *changing the grid* and watching the selection move + ([[artifact-pinning-test-cannot-see-the-code]]); +* **each guard has a positive control** — a refusal that fires on everything passes + ``pytest.raises`` exactly as happily as a correct one + ([[raises-test-needs-a-positive-control]]); +* **the record rule is asserted by IDENTITY** — a record with one passing and one + failing query is the only case distinguishing ANY from ALL, and counts alone are + blind to the two being swapped ([[symmetric-count-fixture-blind-to-inversion]]). +""" + +from __future__ import annotations + +import json +from pathlib import Path + +import pytest + +from tbox_finder.mining import architecture_param_measure as apm +from tbox_finder.mining import architecture_param_recommend as rec +from tbox_finder.mining.architecture_param_control_compare import CompareError +from tbox_finder.mining.curated_control_sizing import wilson_interval +from tbox_finder.mining.spare_rule import ( + STATUS_FAILED, + STATUS_PASSED, + STATUS_UNAVAILABLE, +) + +# ═════════════════════════════════════════════════════════════════════════════ +# Fixtures +# ═════════════════════════════════════════════════════════════════════════════ +#: Two 2-pair helices with a ``UG`` register in the first flanked bulge. +SS_TWO_HELIX = "((..((....))..))" +ROW_WITH_UG = "GGUGGGAAAACCCUGC" +#: One helix, no flanked bulge — fails (b) at every setting in the sweep. +SS_ONE_HELIX = "((((....))))" +ROW_ONE_HELIX = "GGGGAAAACCCC" + +LOOSE = apm.ParamTuple("loose", 1, 1, 2, 1, 10_000, 1, False) +CHOSEN = apm.ParamTuple("sensitive_core", 1, 2, 2, 2, 50, 2, False) + + +def stockholm(ss_cons: str, rows: list[tuple[str, str]]) -> str: + body = "".join(f"{name:20s} {seq}\n" for name, seq in rows) + return f"# STOCKHOLM 1.0\n{body}{'#=GC SS_cons':20s} {ss_cons}\n//\n" + + +def write_consensus(root: Path, slug: str, ss_cons: str, row: str, depth: int = 20) -> None: + rows = [("candidate", row)] + [(f"h{i}", row) for i in range(depth - 1)] + d = root / slug + d.mkdir(parents=True, exist_ok=True) + (d / "msa.sto").write_text(stockholm(ss_cons, rows)) + + +def evidence_row(a: str, c: str, posterior: float | None = 0.01) -> dict: + return {"covariation_status": a, "synteny_status": c, "stage2_posterior": posterior} + + +def point( + *, + params: apm.ParamTuple = CHOSEN, + fp_failed: int = 10, + fp_passed: int = 90, + fp_failed_with_a: int = 5, + fp_loci_decided: int = 90, + fp_loci_failing_a_and_b: int = 5, + mined: int = 3, + damage: int = 8, + b_only_extra: int = 2, + producible: int = 68, +) -> rec.PointResult: + """A :class:`PointResult` with only the fields a given assertion reads. + + ``damage`` is the (a)∧(b) record count; ``b_only_extra`` is how many further records + lose (b) alone, so the two never arrive equal by default. + """ + return rec.PointResult( + params=params, + fp_failed=fp_failed, + fp_passed=fp_passed, + fp_failed_with_a_failed=fp_failed_with_a, + fp_loci_decided=fp_loci_decided, + fp_loci_failing_a_and_b=fp_loci_failing_a_and_b, + mined_by_threshold={"stage2_not_declared": mined}, + mined_loci_by_threshold={"stage2_not_declared": mined}, + control={ + # ⚠ (a)∧(b) and (b)-alone are DIFFERENT by default. Giving both the same + # `damage` made every consumer of this helper blind to the two being + # interchanged, which is the inversion the file header claims to defend + # against ([[symmetric-count-fixture-blind-to-inversion]]). + "n_records_losing_a_and_b": damage, + "n_records_losing_b": damage + b_only_extra, + "n_records_producible": producible, + "n_queries_decided": 76, + "n_queries_a_and_b_failed": damage, + "share_records_losing_a_and_b_ci95": [0.0, 1.0], + }, + ) + + +# ═════════════════════════════════════════════════════════════════════════════ +# The grid, and admissibility measured rather than re-encoded +# ═════════════════════════════════════════════════════════════════════════════ +def test_grid_is_the_full_cross_product_of_the_shipped_axes(): + expected = ( + len(apm.MIN_NAMED_HELICES_SWEEP) + * len(apm.MIN_HELIX_PAIRS_SWEEP) + * len(apm.BULGE_MIN_NT_SWEEP) + * len(apm.BULGE_MAX_NT_SWEEP) + * len(apm.NCCA_PAIRING_NT_SWEEP) + * 2 + ) + points = rec.grid_points() + assert len(points) == expected + # By VALUE, not by label: two points could carry distinct labels and the same seven + # numbers. (`as_dict()` carries the parameters only — the label is not in it.) + assert len({tuple(sorted(p.as_dict().items())) for p in points}) == expected + + +def test_grid_labels_are_distinct_so_a_point_cannot_shadow_another(): + labels = [p.label for p in rec.grid_points()] + assert len(set(labels)) == len(labels) + + +def test_grid_carries_the_named_six_verbatim(): + """The recommendation is read against the two reports' settings, so they must be IN it.""" + grid = {tuple(sorted(p.as_dict().items())) for p in rec.grid_points()} + for named in apm.default_tuples(): + assert tuple(sorted(named.as_dict().items())) in grid, named.label + + +def test_sweep_arm_returns_the_shipped_refusal_string_for_an_inadmissible_point(tmp_path): + write_consensus(tmp_path, "s1", SS_TWO_HELIX, ROW_WITH_UG) + items = apm.read_supply(tmp_path) + illegal = apm.ParamTuple("illegal", 1, 2, 2, 1, 50, 3, False) # bulge_min 1 < ncca 3 + outcome = rec.sweep_arm(items, illegal) + assert isinstance(outcome, str) + assert "ncca_pairing_nt" in outcome + + +def test_sweep_arm_returns_verdicts_for_an_admissible_point(tmp_path): + """The positive control: the refusal above is about the SETTING, not about everything.""" + write_consensus(tmp_path, "s1", SS_TWO_HELIX, ROW_WITH_UG) + items = apm.read_supply(tmp_path) + outcome = rec.sweep_arm(items, LOOSE) + assert isinstance(outcome, dict) + assert set(outcome) == {"s1"} + assert outcome["s1"] in (STATUS_PASSED, STATUS_FAILED) + + +def test_sweep_arm_agrees_with_the_shipped_candidate_state(tmp_path): + """No second spelling of "what (b) says": the sweep must be candidate_state itself.""" + write_consensus(tmp_path, "s1", SS_TWO_HELIX, ROW_WITH_UG) + write_consensus(tmp_path, "s2", SS_ONE_HELIX, ROW_ONE_HELIX) + items = apm.read_supply(tmp_path) + got = rec.sweep_arm(items, LOOSE) + assert got == {i.slug: apm.candidate_state(i, LOOSE) for i in items} + + +# ═════════════════════════════════════════════════════════════════════════════ +# The spare rule — a CONJUNCTION, broken one member at a time +# ═════════════════════════════════════════════════════════════════════════════ +def test_all_four_disjuncts_failed_is_the_only_mined_case(): + by_id = {"GCA_1.1:c1:0:10-20": evidence_row(STATUS_FAILED, STATUS_FAILED, 0.01)} + assert rec.mined_ids(by_id, {"GCA_1.1:c1:0:10-20": STATUS_FAILED}, stage2_threshold=0.5) == [ + "GCA_1.1:c1:0:10-20" + ] + + +@pytest.mark.parametrize( + "a,c,arch_state,posterior,why", + [ + (STATUS_PASSED, STATUS_FAILED, STATUS_FAILED, 0.01, "criterion (a) passed"), + (STATUS_FAILED, STATUS_PASSED, STATUS_FAILED, 0.01, "criterion (c) passed"), + (STATUS_FAILED, STATUS_FAILED, STATUS_PASSED, 0.01, "criterion (b) passed"), + (STATUS_FAILED, STATUS_FAILED, STATUS_FAILED, 0.99, "the Stage-2 posterior passed"), + (STATUS_UNAVAILABLE, STATUS_FAILED, STATUS_FAILED, 0.01, "criterion (a) unavailable"), + (STATUS_FAILED, STATUS_UNAVAILABLE, STATUS_FAILED, 0.01, "criterion (c) unavailable"), + (STATUS_FAILED, STATUS_FAILED, STATUS_UNAVAILABLE, 0.01, "criterion (b) unavailable"), + (STATUS_FAILED, STATUS_FAILED, STATUS_FAILED, None, "the posterior is missing"), + ], +) +def test_flipping_exactly_one_member_spares_the_candidate(a, c, arch_state, posterior, why): + """Each member ALONE — an all-failed fixture cannot see which member is unread.""" + by_id = {"GCA_1.1:c1:0:10-20": evidence_row(a, c, posterior)} + assert rec.mined_ids(by_id, {"GCA_1.1:c1:0:10-20": arch_state}, stage2_threshold=0.5) == [], why + + +def test_a_candidate_absent_from_the_architecture_column_is_spared_not_mined(): + """The fail-open version of this default mines the whole corpus.""" + by_id = {"GCA_1.1:c1:0:10-20": evidence_row(STATUS_FAILED, STATUS_FAILED, 0.01)} + assert rec.mined_ids(by_id, {}, stage2_threshold=0.5) == [] + + +def test_stage2_not_declared_removes_the_disjunct_rather_than_failing_it(): + """threshold None is D14's phase-conditioning, not 'the posterior failed'.""" + by_id = {"GCA_1.1:c1:0:10-20": evidence_row(STATUS_FAILED, STATUS_FAILED, 0.99)} + assert rec.mined_ids(by_id, {"GCA_1.1:c1:0:10-20": STATUS_FAILED}, stage2_threshold=None) == [ + "GCA_1.1:c1:0:10-20" + ] + assert rec.mined_ids(by_id, {"GCA_1.1:c1:0:10-20": STATUS_FAILED}, stage2_threshold=0.5) == [] + + +def test_yield_ceiling_counts_the_a_and_c_intersection_not_either_alone(): + by_id = { + "GCA_1.1:c1:0:10-20": evidence_row(STATUS_FAILED, STATUS_FAILED), + "GCA_1.1:c1:0:30-40": evidence_row(STATUS_FAILED, STATUS_PASSED), + "GCA_1.1:c1:0:50-60": evidence_row(STATUS_PASSED, STATUS_FAILED), + "GCA_1.1:c1:0:70-80": evidence_row(STATUS_PASSED, STATUS_PASSED), + } + out = rec.yield_ceiling(by_id, ids_with_consensus=list(by_id)) + assert out["n_criterion_a_failed"] == 2 + assert out["n_criterion_c_failed"] == 2 + assert out["n_failing_both_a_and_c"] == 1 + assert out["candidate_ids_at_the_ceiling"] == ["GCA_1.1:c1:0:10-20"] + assert out["by_stage2_threshold"]["stage2_not_declared"] == { + "max_mined_if_b_failed_everywhere": 1, + "max_mined_if_b_failed_everywhere_loci": 1, + "min_mined_if_b_passed_everywhere": 0, + } + + +def test_the_ceiling_excludes_a_candidate_with_no_consensus(): + """(b) reads 'unavailable' without an msa.sto, and unavailable SPARES.""" + by_id = {"GCA_1.1:c1:0:10-20": evidence_row(STATUS_FAILED, STATUS_FAILED)} + out = rec.yield_ceiling(by_id, ids_with_consensus=[]) + assert out["n_failing_both_a_and_c"] == 1 + assert out["n_failing_both_a_and_c_with_a_consensus"] == 0 + assert ( + out["by_stage2_threshold"]["stage2_not_declared"]["max_mined_if_b_failed_everywhere"] == 0 + ) + + +# ═════════════════════════════════════════════════════════════════════════════ +# Control damage — ANY-passes-spares, asserted by identity +# ═════════════════════════════════════════════════════════════════════════════ +REC_A, REC_B, REC_C = "aaa:c0", "bbb:c0", "ccc:c0" +Q_A1, Q_A2 = f"{REC_A}:0:10-20", f"{REC_A}:0:30-40" +Q_B1, Q_B2 = f"{REC_B}:0:10-20", f"{REC_B}:0:30-40" +Q_C1 = f"{REC_C}:0:10-20" + + +def control_manifest(tmp_path, ids, accession_of=None) -> Path: + """A control manifest in the shape ``load_control_records`` reads.""" + path = tmp_path / "control_manifest.json" + path.write_text( + json.dumps( + { + "candidates": [ + { + "candidate_id": q, + "accession": (accession_of or (lambda x: ":".join(x.split(":")[:2])))(q), + } + for q in ids + ] + } + ) + ) + return path + + +def test_control_records_groups_queries_by_the_manifests_accession(tmp_path): + status = {Q_A1: STATUS_FAILED, Q_A2: STATUS_PASSED, Q_B1: STATUS_FAILED} + manifest = control_manifest(tmp_path, list(status)) + assert rec.control_records(status, manifest) == {REC_A: [Q_A1, Q_A2], REC_B: [Q_B1]} + + +def test_control_records_refuses_a_status_table_that_is_a_different_corpus(tmp_path): + """The grouping and the scores must describe the same queries, not merely the same n.""" + manifest = control_manifest(tmp_path, [Q_A1, Q_A2]) + with pytest.raises(rec.RecommendError, match="different corpora"): + rec.control_records({Q_A1: STATUS_FAILED, Q_B1: STATUS_FAILED}, manifest) + + +@pytest.mark.parametrize( + "bad", + [ + pytest.param("faled", id="a_typo"), + pytest.param(None, id="a_null"), + pytest.param(1, id="a_number"), + pytest.param("", id="an_empty_string"), + ], +) +def test_control_records_refuses_a_status_value_it_cannot_spell(tmp_path, bad): + """An unspellable status is not decided, so it silently leaves the 68-record rate. + + ``control_damage`` reads producibility as ``status[q] in DECIDED_STATES``: a typo does + not raise, it removes that query from the denominator every share and interval on this + arm is computed against. The FP arm's columns go through ``checked_status`` in the + writer AND the reader; this arm did not. + """ + status = {Q_A1: STATUS_FAILED, Q_A2: bad} + with pytest.raises(rec.RecommendError, match="control status"): + rec.control_records(status, control_manifest(tmp_path, [Q_A1, Q_A2])) + + +def test_the_control_status_check_admits_every_shipped_state(tmp_path): + """Positive control: `unavailable` is a legitimate value, not a defect to refuse.""" + status = {Q_A1: STATUS_PASSED, Q_A2: STATUS_UNAVAILABLE, Q_B1: STATUS_FAILED} + assert rec.control_records(status, control_manifest(tmp_path, list(status))) == { + REC_A: [Q_A1, Q_A2], + REC_B: [Q_B1], + } + + +def test_control_records_names_the_status_table_not_the_manifest(tmp_path): + """A refusal that sends the reader to the wrong file is one they will disbelieve. + + ``checked_status`` prints its first argument as where the bad value lives, and the bad + value here comes from the status table. + """ + manifest = control_manifest(tmp_path, [Q_A1, Q_A2]) + status_path = tmp_path / "ctrl_status_v0.json" + with pytest.raises(rec.RecommendError, match="ctrl_status_v0.json"): + rec.control_records({Q_A1: STATUS_FAILED, Q_A2: "faled"}, manifest, status_path=status_path) + + +def test_control_records_refuses_a_manifest_row_that_contradicts_its_own_id(tmp_path): + """The shipped loader is the one that owns this refusal; delegating means inheriting it. + + ⚠ The exception type is NAMED. ``pytest.raises(Exception)`` would accept an + ``AttributeError`` or a ``KeyError`` just as happily, so a regression turning the + refusal into a crash would keep this green. + """ + manifest = control_manifest(tmp_path, [Q_A1, Q_A2], accession_of=lambda q: "one:record") + with pytest.raises((rec.RecommendError, CompareError), match="record|accession"): + rec.control_records({Q_A1: STATUS_FAILED, Q_A2: STATUS_FAILED}, manifest) + + +def test_one_surviving_query_spares_the_whole_record(tmp_path): + """The ANY/ALL witness: record A has one failing and one passing query.""" + status = {Q_A1: STATUS_FAILED, Q_A2: STATUS_FAILED, Q_B1: STATUS_FAILED, Q_B2: STATUS_FAILED} + records = rec.control_records(status, control_manifest(tmp_path, list(status))) + arch_by_query = { + Q_A1: STATUS_FAILED, + Q_A2: STATUS_PASSED, # <- the survivor + Q_B1: STATUS_FAILED, + Q_B2: STATUS_FAILED, + } + out = rec.control_damage(status, records, arch_by_query) + assert out["n_records_producible"] == 2 + assert out["n_records_losing_b"] == 1, "only record B loses (b) on every query" + assert out["n_queries_b_failed"] == 3, "the query count sees three; the record rule sees one" + + +def test_the_conjunction_needs_criterion_a_to_have_failed_too(tmp_path): + """A record whose queries fail (b) but PASS (a) is spared and must not be counted.""" + status = {Q_A1: STATUS_PASSED, Q_A2: STATUS_PASSED, Q_B1: STATUS_FAILED, Q_B2: STATUS_FAILED} + records = rec.control_records(status, control_manifest(tmp_path, list(status))) + arch_by_query = dict.fromkeys([Q_A1, Q_A2, Q_B1, Q_B2], STATUS_FAILED) + out = rec.control_damage(status, records, arch_by_query) + assert out["n_records_losing_b"] == 2, "(b) alone fails on both records" + assert out["n_records_losing_a_and_b"] == 1, "only record B also failed (a)" + + +def asymmetric_control(tmp_path): + """One control corpus in which every counter of `control_damage` takes a DIFFERENT value. + + Built so that no two published quantities coincide — the shape a uniform fixture cannot + have, and the reason the sabotages below bite: + + * record A — ``Q_A1`` fails (a) and (b); ``Q_A2`` fails (b) but PASSES (a) + ⇒ A loses (b) on every query but is spared under the conjunction, so ANY/ALL and + (b)-alone/(a)∧(b) are distinguishable in the same record; + * record B — ``Q_B1`` fails both; ``Q_B2`` is UNAVAILABLE ⇒ not producible + ⇒ B is damaged on its one decided query, and the query denominator must exclude the + other, so ``n_queries_decided`` (4) differs from the query total (5); + * record C — ``Q_C1`` fails (a) only, and PASSES (b) ⇒ C is producible and undamaged. + + Expected: 3 producible records · 1 losing (a)∧(b) · 2 losing (b) · 4 decided queries of + 5 · 3 failing (b) · 2 failing both — six quantities, no two equal by accident. + """ + status = { + Q_A1: STATUS_FAILED, + Q_A2: STATUS_PASSED, + Q_B1: STATUS_FAILED, + Q_B2: STATUS_UNAVAILABLE, + Q_C1: STATUS_FAILED, + } + arch = { + Q_A1: STATUS_FAILED, + Q_A2: STATUS_FAILED, + Q_B1: STATUS_FAILED, + Q_B2: STATUS_FAILED, + Q_C1: STATUS_PASSED, + } + records = rec.control_records(status, control_manifest(tmp_path, list(status))) + return status, records, arch + + +def test_the_record_damage_rule_is_ALL_of_the_producible_queries(tmp_path): + """`all(` -> `any(` at the (a)∧(b) record rule left the whole suite green. + + This is the number the §7 choice was made against — "8 of 68 control records lose both + protections" — so the quantifier it rests on must be pinned by a fixture that can tell + ALL from ANY: record A has one query failing both and one passing (a) + ([[all-true-fixture-cannot-test-a-conjunction]]). + """ + status, records, arch = asymmetric_control(tmp_path) + out = rec.control_damage(status, records, arch) + assert out["n_records_producible"] == 3 + assert out["n_records_losing_a_and_b"] == 1, "A survives: its second query passes (a)" + assert out["n_records_losing_b"] == 2, "A and B lose (b) on every producible query" + + +def test_the_query_damage_count_keeps_its_criterion_a_conjunct(tmp_path): + """Dropping `and status[q] == STATUS_FAILED` republished the (b)-only count as (a)∧(b). + + Nothing asserted `n_queries_a_and_b_failed` against real output, so the published + query-level count could silently become the larger (b)-only one. + """ + status, records, arch = asymmetric_control(tmp_path) + out = rec.control_damage(status, records, arch) + assert out["n_queries_b_failed"] == 3 + assert out["n_queries_a_and_b_failed"] == 2, "Q_A2 fails (b) but passes (a)" + assert out["n_queries_a_and_b_failed"] != out["n_queries_b_failed"] + + +def test_the_query_denominator_counts_only_producible_queries(tmp_path): + """`n_queries_decided` must exclude an `unavailable` query of a producible record. + + Record B contributes one decided query and one spared one, so the denominator (4) and + the raw query total (5) differ — a record-level fixture cannot show this. + """ + status, records, arch = asymmetric_control(tmp_path) + out = rec.control_damage(status, records, arch) + assert sum(len(q) for q in records.values()) == 5 + assert out["n_queries_decided"] == 4 + + +def test_each_published_share_divides_its_OWN_numerator(tmp_path): + """Swapping the two `wilson_interval` calls, or the two numerators, stayed green. + + Both shares were only ever asserted where every count was equal, so nothing bound a + share — or its interval — to the count it claims to summarise. + """ + status, records, arch = asymmetric_control(tmp_path) + out = rec.control_damage(status, records, arch) + assert out["share_records_losing_a_and_b"] == round(1 / 3, 6) + assert out["share_records_losing_b"] == round(2 / 3, 6) + # ⚠ By IDENTITY against each interval's OWN numerator, not by containment: at n = 3 + # the two Wilson intervals are wide enough that EACH contains the other's point + # estimate, so a containment test passes with the two swapped + # ([[symmetric-count-fixture-blind-to-inversion]]). + lo_ab, hi_ab = wilson_interval(1, 3) + lo_b, hi_b = wilson_interval(2, 3) + assert out["share_records_losing_a_and_b_ci95"] == [round(lo_ab, 6), round(hi_ab, 6)] + assert out["share_records_losing_b_ci95"] == [round(lo_b, 6), round(hi_b, 6)] + assert out["share_records_losing_a_and_b_ci95"] != out["share_records_losing_b_ci95"] + + +def test_a_record_with_no_producible_query_leaves_the_denominator(tmp_path): + status = {Q_A1: STATUS_FAILED, Q_C1: STATUS_UNAVAILABLE} + records = rec.control_records(status, control_manifest(tmp_path, list(status))) + out = rec.control_damage(status, records, {Q_A1: STATUS_FAILED}) + assert out["n_records_producible"] == 1 + + +def test_a_query_level_ci_is_refused_and_the_reason_travels_with_it(tmp_path): + status = {Q_A1: STATUS_FAILED} + out = rec.control_damage( + status, + rec.control_records(status, control_manifest(tmp_path, list(status))), + {Q_A1: STATUS_FAILED}, + ) + assert out["query_level_ci95"] is None + assert "pseudo-replicated" in out["why_no_query_ci"] + assert out["share_records_losing_a_and_b_ci95"][0] < out["share_records_losing_a_and_b_ci95"][1] + + +def test_the_missing_criterion_c_on_the_control_is_disclosed_not_absorbed(tmp_path): + status = {Q_A1: STATUS_FAILED} + out = rec.control_damage( + status, + rec.control_records(status, control_manifest(tmp_path, list(status))), + {Q_A1: STATUS_FAILED}, + ) + assert "UPPER" in out["criterion_c_not_in_this_conjunction"] + + +# ═════════════════════════════════════════════════════════════════════════════ +# The decision rule +# ═════════════════════════════════════════════════════════════════════════════ +@pytest.mark.parametrize( + "params,violates", + [ + (apm.ParamTuple("x", 1, 1, 2, 2, 50, 2, False), "min_named_helices >= 2"), + (apm.ParamTuple("x", 1, 2, 1, 2, 50, 2, False), "min_helix_pairs >= 2"), + (apm.ParamTuple("x", 1, 2, 2, 1, 50, 1, False), "ncca_pairing_nt >= 2"), + (apm.ParamTuple("x", 1, 2, 2, 2, 10_000, 2, False), "bulge_max_nt is bounded"), + ], +) +def test_each_floor_is_violated_alone(params, violates): + """One member broken at a time — the conjunction cannot hide a floor nobody reads.""" + assert not rec.clears_all_floors(params) + assert violates not in rec.floors_passed(params) + assert len(rec.floors_passed(params)) == len(rec.DECISION_FLOORS) - 1 + + +def test_the_recommended_shape_clears_every_floor(): + """The positive control for the four parametrised refusals above.""" + assert rec.clears_all_floors(CHOSEN) + assert len(rec.floors_passed(CHOSEN)) == len(rec.DECISION_FLOORS) + + +def test_the_rule_selects_the_most_permissive_survivor_not_the_first_one(): + permissive = point(params=CHOSEN, fp_failed=10) + strict = point(params=apm.ParamTuple("strict", 1, 3, 2, 4, 50, 2, False), fp_failed=99) + out = rec.apply_decision_rule([strict, permissive]) + assert out["chosen"] is permissive + assert out["n_at_the_measured_minimum"] == 1 + + +def test_the_rule_ignores_a_more_permissive_point_that_fails_a_floor(): + """Otherwise the floors are decoration: the argmin would walk straight past them.""" + below_floor = point(params=apm.ParamTuple("loose", 1, 1, 2, 1, 10_000, 1, False), fp_failed=1) + out = rec.apply_decision_rule([below_floor, point(params=CHOSEN, fp_failed=10)]) + assert out["chosen"].params.as_dict() == CHOSEN.as_dict() + assert out["n_clearing_every_floor"] == 1 + + +def test_ties_resolve_toward_the_value_that_claims_less(): + wobble_on = point(params=apm.ParamTuple("w1", 1, 2, 2, 2, 50, 2, True), fp_failed=10) + wobble_off = point(params=CHOSEN, fp_failed=10) + out = rec.apply_decision_rule([wobble_on, wobble_off]) + assert out["chosen"].params.allow_wobble is False + assert out["tied_with"] == [wobble_on.params.as_dict()] + + +def test_a_tie_the_break_order_cannot_resolve_is_refused(): + """Two settings differing only in a parameter NOT proved inert must stop the rule.""" + a = point(params=apm.ParamTuple("a", 1, 2, 2, 2, 50, 2, False), fp_failed=10) + b = point(params=apm.ParamTuple("b", 1, 3, 2, 2, 50, 2, False), fp_failed=10) + with pytest.raises(rec.RecommendError, match="tied"): + rec.apply_decision_rule([a, b]) + + +def test_a_tie_differing_in_a_non_inert_axis_is_refused_even_when_the_keys_differ(): + """The refusal must test the VOCABULARY, not a key collision. + + These two differ in `min_helix_pairs` (which TIE_BREAK_ORDER cannot speak to) *and* in + `bulge_max_nt` (which it can). A key comparison separates them by `bulge_max_nt` alone + and publishes a `min_helix_pairs` the rule never chose. + """ + a = point(params=apm.ParamTuple("a", 1, 2, 2, 2, 20, 2, False), fp_failed=10) + b = point(params=apm.ParamTuple("b", 1, 2, 3, 2, 50, 2, False), fp_failed=10) + with pytest.raises(rec.RecommendError, match="min_helix_pairs"): + rec.apply_decision_rule([a, b]) + + +def test_a_tie_only_inside_the_tie_break_vocabulary_is_resolved_not_refused(): + """Positive control: differing ONLY in bulge_max_nt is exactly what the order exists for.""" + a = point(params=apm.ParamTuple("a", 1, 2, 2, 2, 50, 2, False), fp_failed=10) + b = point(params=apm.ParamTuple("b", 1, 2, 2, 2, 20, 2, False), fp_failed=10) + out = rec.apply_decision_rule([a, b]) + assert out["chosen"].params.bulge_max_nt == 20, "the narrower stated filter wins" + + +def test_the_tie_break_vocabulary_is_derived_from_the_order_not_restated(): + assert tuple(name for name, _ in rec.TIE_BREAK_ORDER) == rec.TIE_BREAK_VOCABULARY + + +def test_the_tie_refusal_does_not_fire_on_a_single_winner(): + """Positive control: the refusal above is about the tie, not about every input.""" + out = rec.apply_decision_rule([point(params=CHOSEN, fp_failed=10)]) + assert out["chosen"].params.as_dict() == CHOSEN.as_dict() + + +def test_a_grid_with_no_floor_clearing_point_is_refused_not_defaulted(): + below = point(params=apm.ParamTuple("loose", 1, 1, 2, 1, 10_000, 1, False), fp_failed=1) + with pytest.raises(rec.RecommendError, match="no admissible grid point"): + rec.apply_decision_rule([below]) + + +def test_floor_sensitivity_reports_a_floor_that_changes_the_selection(): + chosen = point(params=CHOSEN, fp_failed=10) + cheaper_below_floor = point( + params=apm.ParamTuple("one_helix", 1, 1, 2, 2, 50, 2, False), fp_failed=1 + ) + out = rec.floor_sensitivity([chosen, cheaper_below_floor], chosen) + assert out["min_named_helices >= 2"]["changes_the_selection"] is True + assert out["min_helix_pairs >= 2"]["changes_the_selection"] is False + + +def test_floor_sensitivity_does_not_call_a_differently_measuring_selection_identical(): + """A floor whose removal moves the pick to a setting that measures DIFFERENTLY. + + The twin is strictly more permissive (``fp_failed`` 9 against 10), so it wins on the + metric itself and the tie-break is never consulted — and the identity field must then + read False, not True. Named for what it asserts: the True branch is the test below, + and a name promising one while asserting the other leaves a reader unable to tell + which behaviour is pinned. + """ + chosen = point(params=CHOSEN, fp_failed=10, mined=3, damage=8) + twin_below_the_floor = point( + params=apm.ParamTuple("twin", 1, 1, 2, 2, 50, 2, False), + fp_failed=9, # strictly more permissive, so the tie-break is not consulted + mined=3, + damage=8, + ) + entry = rec.floor_sensitivity([chosen, twin_below_the_floor], chosen)["min_named_helices >= 2"] + assert entry["changes_the_selection"] is True + assert entry["measured_identically_to_the_chosen_setting"] is False, "fp_failed differs" + + +def test_floor_sensitivity_marks_a_changed_selection_that_measures_identically(): + """The TRUE branch: the pick moves, and the setting it moves to measures the same. + + Reached through the bulge floor, the one floor whose parameter is in the tie-break + vocabulary: the sentinel twin is inadmissible while the floor stands, and once it is + dropped it ties on every measured coordinate and wins on ``stem_i_nt_threshold``. The + three-valued field was otherwise pinned only at None and False — on the shipped grid + it takes those two values alone — so nothing asserted that a genuine identity is + reported as one ([[clauses-must-guard-emptiness]]). + """ + chosen = point( + params=apm.ParamTuple("chosen", 5, 2, 2, 2, 50, 2, False), fp_failed=10, mined=3, damage=8 + ) + sentinel_twin = point( + params=apm.ParamTuple("twin", 1, 2, 2, 2, 10_000, 2, False), + fp_failed=10, # a tie, and the twin's smaller stem_i_nt_threshold wins the order + mined=3, + damage=8, + ) + entry = rec.floor_sensitivity([chosen, sentinel_twin], chosen)["bulge_max_nt is bounded"] + assert entry["selection_without_this_floor"]["bulge_max_nt"] == 10_000 + assert entry["changes_the_selection"] is True + assert entry["measured_identically_to_the_chosen_setting"] is True + + +def test_a_floor_whose_removal_leaves_the_rule_undecided_says_so(): + """mhp 1 and mhp 2 measure identically here, so without the floor there is no answer. + + Reporting a tuple anyway would attribute to the rule a decision it refused to make — + and the tuple reported would be whichever the grid enumerated first. + """ + chosen = point(params=CHOSEN, fp_failed=10) + tied_below_the_floor = point( + params=apm.ParamTuple("twin", 1, 2, 1, 2, 50, 2, False), fp_failed=10 + ) + entry = rec.floor_sensitivity([chosen, tied_below_the_floor], chosen)["min_helix_pairs >= 2"] + assert entry["selection_without_this_floor"] is None + assert entry["changes_the_selection"] is None + assert "tied" in entry["the_rule_cannot_decide_without_it"] + + +def test_floor_sensitivity_refuses_a_vacuous_identity_when_nothing_moved(): + """Comparing the chosen setting with itself is identical by construction, not evidence.""" + chosen = point(params=CHOSEN, fp_failed=10, mined=3, damage=8) + sentinel_twin = point( + params=apm.ParamTuple("twin", 1, 2, 2, 2, 10_000, 2, False), + fp_failed=10, + mined=3, + damage=8, + ) + entry = rec.floor_sensitivity([chosen, sentinel_twin], chosen)["bulge_max_nt is bounded"] + assert ( + entry["changes_the_selection"] is False + ), "the tie-break already prefers the bounded value" + assert entry["measured_identically_to_the_chosen_setting"] is None + + +# ═════════════════════════════════════════════════════════════════════════════ +# The frontier and the self-criticism block +# ═════════════════════════════════════════════════════════════════════════════ +def test_the_frontier_keeps_the_cheapest_point_WHEREVER_it_sits_in_the_input(): + """The argmin, not the last-seen: with the cheap point FIRST the loop must keep it. + + Every earlier fixture listed its cheap point last, so replacing the incumbent + comparison with "keep whatever came last" left the whole suite green — and the + frontier is the block that tells the reader what the rule declined to take. + """ + cheap = point(params=CHOSEN, mined=5, damage=8) + dear = point(params=apm.ParamTuple("dear", 1, 3, 2, 4, 50, 2, False), mined=5, damage=40) + for order in ([cheap, dear], [dear, cheap]): + rows = rec.frontier(order) + assert len(rows) == 1 + assert rows[0]["fewest_control_records_losing_a_and_b"] == 8, "the argmin, either way" + assert rows[0]["example_params"] == CHOSEN.as_dict(), "and the row describes THAT point" + + +def test_the_published_fp_share_divides_failed_by_the_decided_total(): + """`share_failed_of_decided` — the FP arm's headline rate — was asserted nowhere. + + `as_dict` is the sole writer of the published field, and no test called it, so the + denominator could become `fp_passed` alone and every report would still render. + """ + body = point(fp_failed=10, fp_passed=90).as_dict() + assert body["fp_arm"]["share_failed_of_decided"] == round(10 / 100, 6) + assert body["fp_arm"]["share_failed_of_decided"] != round(10 / 90, 6) + + +def test_a_point_that_decided_nothing_reports_no_share_rather_than_dividing_by_zero(): + """Positive control for the guard beside it: the `else None` arm is reachable.""" + assert point(fp_failed=0, fp_passed=0).as_dict()["fp_arm"]["share_failed_of_decided"] is None + + +def test_the_frontier_keeps_the_cheapest_point_at_each_yield(): + cheap = point(params=CHOSEN, mined=5, damage=8) + dear = point(params=apm.ParamTuple("dear", 1, 3, 2, 4, 50, 2, False), mined=5, damage=40) + rows = rec.frontier([dear, cheap]) + assert len(rows) == 1 + assert rows[0]["fewest_control_records_losing_a_and_b"] == 8 + assert rows[0]["n_admissible_points_at_this_yield"] == 2 + + +def test_the_restricted_frontier_drops_points_below_the_floors(): + inside = point(params=CHOSEN, mined=5, damage=20) + outside = point(params=apm.ParamTuple("loose", 1, 1, 2, 1, 10_000, 1, False), mined=5, damage=1) + assert rec.frontier([inside, outside])[0]["fewest_control_records_losing_a_and_b"] == 1 + restricted = rec.frontier([inside, outside], only_floor_clearing=True) + assert restricted[0]["fewest_control_records_losing_a_and_b"] == 20 + assert restricted[0]["n_admissible_points_at_this_yield"] == 1 + + +def test_an_empty_damage_denominator_is_refused_not_divided_by(tmp_path): + """A control with no producible record must name its cause, not raise an arithmetic error.""" + status = {Q_A1: STATUS_UNAVAILABLE, Q_B1: STATUS_UNAVAILABLE} + with pytest.raises(rec.RecommendError, match="no decided corpus"): + rec.control_damage( + status, rec.control_records(status, control_manifest(tmp_path, list(status))), {} + ) + + +def test_one_producible_record_is_enough_for_a_denominator(tmp_path): + """Positive control: the refusal above is about emptiness, not about small n.""" + status = {Q_A1: STATUS_FAILED, Q_B1: STATUS_UNAVAILABLE} + out = rec.control_damage( + status, + rec.control_records(status, control_manifest(tmp_path, list(status))), + {Q_A1: STATUS_FAILED}, + ) + assert out["n_records_producible"] == 1 + + +def test_the_bulge_floor_claim_is_measured_against_its_own_sentinel_twin(): + """The rationale says keeping the bound costs nothing; that must be a measurement.""" + chosen = point(params=CHOSEN, fp_failed=10, mined=3, damage=8) + twin = point( + params=apm.ParamTuple("twin", 1, 2, 2, 2, rec.BULGE_MAX_UNBOUNDED, 2, False), + fp_failed=10, + mined=3, + damage=8, + ) + out = rec.bulge_sentinel_comparison([chosen, twin], chosen) + assert out["sentinel_twin_admissible"] is True + assert out["measures_identically"] is True + + +def test_the_sentinel_comparison_reports_a_real_difference_as_one(): + """Positive control: 'measures identically' must be able to come out False.""" + chosen = point(params=CHOSEN, fp_failed=10, mined=3, damage=8) + twin = point( + params=apm.ParamTuple("twin", 1, 2, 2, 2, rec.BULGE_MAX_UNBOUNDED, 2, False), + fp_failed=11, + mined=4, + damage=9, + ) + assert rec.bulge_sentinel_comparison([chosen, twin], chosen)["measures_identically"] is False + + +def test_an_absent_sentinel_twin_is_reported_rather_than_assumed_identical(): + chosen = point(params=CHOSEN, fp_failed=10) + out = rec.bulge_sentinel_comparison([chosen], chosen) + assert out["sentinel_twin_admissible"] is False + assert "measures_identically" not in out + + +def test_the_bulge_floor_rationale_cites_a_field_the_report_actually_carries(): + """The original rationale cited floor_sensitivity, whose field is null in exactly this case.""" + floor = next(f for f in rec.DECISION_FLOORS if f.key == "bulge_max_nt is bounded") + assert "bulge_sentinel_comparison" in floor.rationale + assert "floor_sensitivity" not in floor.rationale.split("NOT readable off")[0] + + +def test_dominating_alternatives_finds_a_strictly_better_floor_clearing_point(): + chosen = point(params=CHOSEN, mined=3, damage=8) + better = point(params=apm.ParamTuple("b", 1, 2, 3, 3, 50, 2, False), mined=5, damage=8) + out = rec.dominating_alternatives([chosen, better], chosen) + assert out["n_settings"] == 1 + assert out["max_extra_mined"] == 2 + assert out["examples_by_yield"][0]["n_mined"] == 5 + + +def test_a_dominating_point_below_a_decision_floor_is_not_counted(): + """The block enumerates what the RULE declined, so it may only list admissible points. + + Both existing fixtures used a floor-clearing alternative, so `clears_all_floors` in + the filter was never exercised: a setting the rule may not choose could be published + as a better one it passed over. `mnh=1` is below the min_named_helices floor. + """ + chosen = point(params=CHOSEN, mined=3, damage=8) + below = point(params=apm.ParamTuple("loose", 1, 1, 2, 2, 50, 2, False), mined=9, damage=1) + out = rec.dominating_alternatives([chosen, below], chosen) + assert out["n_settings"] == 0, "it mines more for less, but the rule cannot take it" + assert out["max_extra_mined"] == 0 + + +def test_dominating_alternatives_does_not_count_a_costlier_point(): + """The positive control: 'dominating' must mean BOTH coordinates, not just yield.""" + chosen = point(params=CHOSEN, mined=3, damage=8) + costlier = point(params=apm.ParamTuple("b", 1, 2, 3, 3, 50, 2, False), mined=5, damage=9) + out = rec.dominating_alternatives([chosen, costlier], chosen) + assert out["n_settings"] == 0 + assert out["max_extra_mined"] == 0 + + +# ═════════════════════════════════════════════════════════════════════════════ +# Anti-selectivity +# ═════════════════════════════════════════════════════════════════════════════ +def test_anti_selectivity_reports_the_direction_the_control_falls_through(): + worse_on_the_control = point( + damage=34, producible=68, fp_loci_failing_a_and_b=10, fp_loci_decided=100 + ) + out = rec.anti_selectivity(worse_on_the_control) + assert out["control_share"] == 0.5 + assert out["fp_share"] == 0.1 + assert out["control_falls_through_more"] is True + assert out["fp_minus_control_pp"] == pytest.approx(-40.0) + assert out["intervals_disjoint"] is True + + +def test_anti_selectivity_is_stated_on_records_and_loci_not_on_rows(): + """The correction: neither row unit is independent, so neither may carry an interval.""" + r = point(damage=8, producible=68, fp_loci_failing_a_and_b=25, fp_loci_decided=199) + out = rec.anti_selectivity(r) + assert out["control_records_failing_a_and_b"] == "8/68" + assert out["fp_loci_failing_a_and_b"] == "25/199" + assert "RECORDS" in out["unit"] and "LOCI" in out["unit"] + assert out["also_at_the_row_level_for_reference"]["no_interval_because"] + + +def test_anti_selectivity_is_not_hardwired_to_one_direction(): + """Positive control for the flag above — swap the arms and it must invert.""" + worse_on_the_fp_arm = point( + damage=7, producible=68, fp_loci_failing_a_and_b=50, fp_loci_decided=100 + ) + out = rec.anti_selectivity(worse_on_the_fp_arm) + assert out["control_falls_through_more"] is False + assert out["fp_minus_control_pp"] > 0 + + +# ═════════════════════════════════════════════════════════════════════════════ +# The manifest's SHAPE — an input, not an invariant (review round 7) +# ═════════════════════════════════════════════════════════════════════════════ +def write_json(tmp_path, name, payload) -> Path: + p = tmp_path / name + p.write_text(json.dumps(payload)) + return p + + +def test_the_manifest_may_be_a_top_level_list_of_rows(tmp_path): + """The shape both call sites MEANT to accept and neither did. + + ``manifest.get("candidates", manifest)`` reads as "the object's rows, or the rows + themselves" — but a list has no ``.get``, so the second shape raised AttributeError, + which is outside ``main``'s except tuple: a traceback where a refusal was intended. + """ + p = write_json(tmp_path, "m.json", [{"candidate_id": "x"}, {"id": "y"}]) + assert rec.read_manifest_ids(p) == ["x", "y"] + + +def test_the_manifest_may_be_an_object_carrying_its_rows(tmp_path): + """Positive control: the shipped shape still reads, so the guard is about SHAPE.""" + p = write_json(tmp_path, "m.json", {"candidates": [{"candidate_id": "x"}], "n_candidates": 1}) + assert rec.read_manifest_ids(p) == ["x"] + + +@pytest.mark.parametrize( + ("payload", "match"), + [ + pytest.param({"n_candidates": 941}, "no candidate rows", id="object_without_candidates"), + pytest.param({"candidates": []}, "no candidate rows", id="empty_candidate_list"), + pytest.param(941, "no candidate rows", id="a_bare_scalar"), + pytest.param([], "no candidate rows", id="an_empty_list"), + pytest.param([{"candidate_id": "x"}, "y"], "not objects", id="a_bare_string_row"), + pytest.param([{"score": 0.5}], "candidate_id", id="a_row_with_neither_id_key"), + ], +) +def test_a_manifest_shape_that_cannot_be_read_is_refused_not_raised(tmp_path, payload, match): + """Every one of these escaped as AttributeError, TypeError or ProducerError before. + + ``ProducerError`` is a ``RuntimeError``, so the row-with-no-id case escaped ``main`` + just as the shape cases did — the refusal has to be re-raised in this module's own + error type, not merely delegated. + """ + with pytest.raises(rec.RecommendError, match=match): + rec.read_manifest_ids(write_json(tmp_path, "m.json", payload)) + + +def test_an_unreadable_manifest_is_refused_with_its_path(tmp_path): + with pytest.raises(rec.RecommendError, match="cannot read the manifest"): + rec.read_manifest_ids(tmp_path / "absent.json") + + +def test_build_inputs_reads_the_manifest_through_the_shared_reader(tmp_path): + """The wiring, not the helper: a list-shaped manifest must reach the join. + + Testing ``read_manifest_ids`` alone would stay green with either call site still + holding its own copy of the old expression + ([[artifact-pinning-test-cannot-see-the-code]]). + """ + manifest = write_json(tmp_path, "m.json", [{"candidate_id": "x"}]) + out = rec.build_inputs( + covariation_status_path=write_json(tmp_path, "cov.json", {"status": {"x": STATUS_FAILED}}), + synteny_status_path=write_json(tmp_path, "syn.json", {"status": {"x": STATUS_PASSED}}), + stage2_posteriors_path=write_json(tmp_path, "p.json", {"posteriors": {"x": 0.25}}), + fp_manifest_path=manifest, + ) + assert [row["candidate_id"] for row in out["rows"]] == ["x"] + + +def test_recommend_reads_the_manifest_through_the_shared_reader(tiny_corpus, tmp_path): + """The second call site, wired the same way — the one a single fix would have missed. + + ([[fixed-one-of-two-identical-things]] — three review rounds running have found a fix + landed on one of two identical call sites.) + """ + rows = json.loads(Path(tiny_corpus["fp_manifest_path"]).read_text())["candidates"] + as_a_list = write_json(tmp_path, "l.json", rows) + body = rec.recommend(**{**tiny_corpus, "fp_manifest_path": as_a_list}) + assert body["pins_nothing"] is True + + +# ═════════════════════════════════════════════════════════════════════════════ +# Binding the report to its evidence +# ═════════════════════════════════════════════════════════════════════════════ +def test_a_partial_overlap_of_the_same_size_is_refused(): + """The failure a cardinality check cannot see: same n, different corpus.""" + status = {"a": STATUS_PASSED, "b": STATUS_FAILED, "c": STATUS_FAILED} + with pytest.raises(rec.RecommendError, match="decided set"): + rec.assert_supply_is_the_decided_set("FP", ["a", "b", "z"], status) + + +def test_the_decided_set_check_passes_on_the_real_thing(): + status = {"a": STATUS_PASSED, "b": STATUS_FAILED, "c": STATUS_UNAVAILABLE} + rec.assert_supply_is_the_decided_set("FP", ["a", "b"], status) + + +def test_a_consensus_for_an_undecided_candidate_is_refused(): + status = {"a": STATUS_PASSED, "c": STATUS_UNAVAILABLE} + with pytest.raises(rec.RecommendError, match="did not decide"): + rec.assert_supply_is_the_decided_set("FP", ["a", "c"], status) + + +def test_a_duplicated_manifest_id_is_refused_by_the_coverage_check(): + """A set-equality check reads as exact while the row count is already wrong.""" + with pytest.raises(rec.RecommendError, match="duplicated candidate_id"): + rec.assert_covers_manifest({"a": {}, "b": {}}, ["a", "b", "b"]) + + +def test_a_supply_naming_one_candidate_twice_is_refused(): + """`set(supply_ids)` merged the repeat and the equality then read as exact. + + The same shape `assert_covers_manifest` refuses on the manifest side + ([[duplicate-key-merges-instead-of-colliding]]): two consensuses for one candidate + would be counted twice by every per-item loop while the set comparison agreed. + """ + status = {"a": STATUS_PASSED, "b": STATUS_FAILED} + with pytest.raises(rec.RecommendError, match="more than once"): + rec.assert_supply_is_the_decided_set("FP", ["a", "b", "b"], status) + + +def test_two_candidates_claiming_one_slug_are_refused_not_merged(tmp_path): + """A dict comprehension kept the LAST id and dropped the other, counts reconciling. + + The reachable trigger is a repeated id — `candidate_slug` appends a 12-hex digest of + the exact id, so two DISTINCT ids cannot collide — and a repeat exercises the same + merge branch the guard exists for ([[duplicate-key-merges-instead-of-colliding]]). + """ + with pytest.raises(rec.RecommendError, match="claimed by two candidate ids"): + rec.index_by_slug("FP", tmp_path, [Q_A1, Q_A1]) + + +def test_the_slug_index_maps_distinct_candidates_to_distinct_slugs(tmp_path): + """Positive control, and the property the guard assumes: the slug is 1:1 on ids.""" + index = rec.index_by_slug("FP", tmp_path, [Q_A1, Q_A2]) + assert sorted(index.values()) == sorted([Q_A1, Q_A2]) + assert len(index) == 2 + + +def test_the_duplicate_refusal_does_not_fire_on_a_distinct_supply(): + """Positive control — and the ids arrive as a GENERATOR at one of the two call sites, + so materialising them must not consume the supply before the comparison.""" + status = {"a": STATUS_PASSED, "b": STATUS_FAILED} + rec.assert_supply_is_the_decided_set("FP", iter(["a", "b"]), status) + + +def test_distinct_manifest_ids_pass(): + """Positive control for the duplicate refusal.""" + rec.assert_manifest_ids_distinct(["a", "b", "c"]) + + +def test_covering_the_manifest_refuses_both_directions(): + with pytest.raises(rec.RecommendError, match="missing"): + rec.assert_covers_manifest({"a": {}}, ["a", "b"]) + with pytest.raises(rec.RecommendError, match="extra"): + rec.assert_covers_manifest({"a": {}, "b": {}}, ["a"]) + rec.assert_covers_manifest({"a": {}, "b": {}}, ["a", "b"]) + + +def test_a_duplicate_candidate_id_is_refused_rather_than_merged(tmp_path): + """A dict comprehension would MERGE them and every derived count would reconcile.""" + p = tmp_path / "inputs.json" + row = {"candidate_id": "x", **evidence_row(STATUS_FAILED, STATUS_FAILED)} + p.write_text(json.dumps({"rows": [row, dict(row)]})) + with pytest.raises(rec.RecommendError, match="duplicate candidate_id"): + rec.load_spare_rule_inputs(p) + + +@pytest.mark.parametrize( + "row,match", + [ + ( + {"candidate_id": "x", "covariation_status": "nope", "synteny_status": "failed"}, + "expected", + ), + ( + {"candidate_id": "x", "covariation_status": "failed", "synteny_status": "nope"}, + "expected", + ), + ( + { + "candidate_id": "x", + "covariation_status": "failed", + "synteny_status": "failed", + "stage2_posterior": "high", + }, + "non-numeric", + ), + ({"covariation_status": "failed", "synteny_status": "failed"}, "no candidate_id"), + ( + { + "candidate_id": "x", + "covariation_status": "failed", + "synteny_status": "failed", + # bool subclasses int, so it reads as 1.0 and SPARES at every threshold. + "stage2_posterior": True, + }, + "non-numeric", + ), + ( + { + "candidate_id": "x", + "covariation_status": "failed", + "synteny_status": "failed", + "stage2_posterior": 12.5, + }, + r"outside \[0, 1\]", + ), + ], +) +def test_a_malformed_spare_rule_input_row_is_refused(tmp_path, row, match): + p = tmp_path / "inputs.json" + p.write_text(json.dumps({"rows": [row]})) + with pytest.raises(rec.RecommendError, match=match): + rec.load_spare_rule_inputs(p) + + +def posterior_inputs(tmp_path, literal: str) -> Path: + """A one-row inputs file whose posterior is written as a raw JSON literal. + + ``json.dumps`` cannot express these two: an integer beyond float range comes back + from ``json.loads`` as a Python ``int``, and ``1e400`` as ``inf``. + """ + p = tmp_path / "inputs.json" + p.write_text( + '{"rows": [{"candidate_id": "x", "covariation_status": "failed", ' + f'"synteny_status": "failed", "stage2_posterior": {literal}}}]}}' + ) + return p + + +def test_a_posterior_too_large_for_a_float_is_refused_not_raised(tmp_path): + """`float(10**400)` raises OverflowError — an ArithmeticError `main` does not catch. + + JSON bounds no integer, so the column can carry one; the CLI would have ended in a + traceback where every other malformed posterior gets `refused:`. + """ + with pytest.raises(rec.RecommendError, match="too large to represent"): + rec.load_spare_rule_inputs(posterior_inputs(tmp_path, "9" * 400)) + + +def test_a_posterior_that_parses_to_infinity_is_refused_by_the_range_test(tmp_path): + """Positive control for the branch above: `1e400` parses to `inf`, not to an int.""" + with pytest.raises(rec.RecommendError, match=r"outside \[0, 1\]"): + rec.load_spare_rule_inputs(posterior_inputs(tmp_path, "1e400")) + + +def test_a_well_formed_spare_rule_input_loads(tmp_path): + """Positive control for the four refusals above.""" + p = tmp_path / "inputs.json" + p.write_text( + json.dumps({"rows": [{"candidate_id": "x", **evidence_row(STATUS_FAILED, STATUS_PASSED)}]}) + ) + loaded = rec.load_spare_rule_inputs(p) + assert set(loaded["by_id"]) == {"x"} + + +def test_build_inputs_refuses_a_column_that_does_not_cover_the_manifest(tmp_path): + manifest = tmp_path / "m.json" + manifest.write_text(json.dumps({"candidates": [{"candidate_id": "x"}, {"candidate_id": "y"}]})) + cov = tmp_path / "cov.json" + cov.write_text(json.dumps({"status": {"GCA_1.1:c1:0:10-20": STATUS_FAILED}})) + syn = tmp_path / "syn.json" + syn.write_text(json.dumps({"status": {"x": STATUS_FAILED, "y": STATUS_FAILED}})) + post = tmp_path / "p.json" + post.write_text(json.dumps({"posteriors": {"x": 0.1, "y": 0.2}})) + with pytest.raises(rec.RecommendError, match="covariation table is missing"): + rec.build_inputs( + covariation_status_path=cov, + synteny_status_path=syn, + stage2_posteriors_path=post, + fp_manifest_path=manifest, + ) + + +def test_build_inputs_refuses_a_column_carrying_an_id_the_manifest_does_not(tmp_path): + manifest = tmp_path / "m.json" + manifest.write_text(json.dumps({"candidates": [{"candidate_id": "x"}]})) + cov = tmp_path / "cov.json" + cov.write_text(json.dumps({"status": {"x": STATUS_FAILED, "ghost": STATUS_FAILED}})) + syn = tmp_path / "syn.json" + syn.write_text(json.dumps({"status": {"GCA_1.1:c1:0:10-20": STATUS_FAILED}})) + post = tmp_path / "p.json" + post.write_text(json.dumps({"posteriors": {"x": 0.1}})) + with pytest.raises(rec.RecommendError, match="absent from the manifest"): + rec.build_inputs( + covariation_status_path=cov, + synteny_status_path=syn, + stage2_posteriors_path=post, + fp_manifest_path=manifest, + ) + + +def test_build_inputs_joins_and_discloses_the_unanchored_column(tmp_path): + manifest = tmp_path / "m.json" + cid = "GCA_1.1:c1:0:10-20" + manifest.write_text(json.dumps({"candidates": [{"candidate_id": cid}]})) + cov = tmp_path / "cov.json" + cov.write_text(json.dumps({"status": {cid: STATUS_FAILED}})) + syn = tmp_path / "syn.json" + syn.write_text(json.dumps({"status": {cid: STATUS_PASSED}})) + post = tmp_path / "p.json" + post.write_text(json.dumps({"posteriors": {cid: 0.25}})) + out = rec.build_inputs( + covariation_status_path=cov, + synteny_status_path=syn, + stage2_posteriors_path=post, + fp_manifest_path=manifest, + ) + assert out["rows"] == [ + { + "candidate_id": cid, + "covariation_status": STATUS_FAILED, + "synteny_status": STATUS_PASSED, + "stage2_posterior": 0.25, + } + ] + assert out["sources"]["stage2_posteriors"]["anchored_by"] is None + assert "SENSITIVITY" in out["sources"]["stage2_posteriors"]["warning"] + + +# ═════════════════════════════════════════════════════════════════════════════ +# The published contract +# ═════════════════════════════════════════════════════════════════════════════ +def test_the_adr_string_names_the_delegation_the_recommendation_relies_on(): + """A4 is what lets a round supply these values at all; the report must cite it.""" + assert "A4" in rec.ADR + assert "no defaults" in rec.ADR + + +def test_every_floor_carries_a_rationale_and_a_source(): + for floor in rec.DECISION_FLOORS: + body = floor.as_dict() + assert body["rationale"].strip() + assert body["source"].strip() + + +def test_a_floor_that_is_an_assumption_says_so_rather_than_citing_an_ADR(): + """min_helix_pairs has no ADR clause behind it; the source must not imply one.""" + floor = next(f for f in rec.DECISION_FLOORS if f.key == "min_helix_pairs >= 2") + assert "ASSUMPTION" in floor.source + assert "NO concept of stacked-pair depth" in floor.rationale + + +def test_the_min_named_helices_floor_names_the_competing_reading(): + """The level is the §7 choice; a rationale that hid the other reading would decide it.""" + floor = next(f for f in rec.DECISION_FLOORS if f.key.startswith("min_named_helices")) + assert "§7" in floor.rationale + assert "named_elements_present" in floor.source + assert set(rec.MIN_NAMED_HELICES_READINGS) >= {2, 3} + + +def test_the_decision_rule_statement_names_what_it_refuses_to_do(): + """The rule's whole defence is that it is not an argmax; that must be IN the artifact.""" + assert "argmax" in rec.DECISION_RULE_STATEMENT + assert "fitted" in rec.DECISION_RULE_STATEMENT + + +def test_the_tie_break_order_covers_only_parameters_it_can_justify(): + covered = {name for name, _ in rec.TIE_BREAK_ORDER} + assert covered == {"allow_wobble", "stem_i_nt_threshold", "bulge_max_nt"} + + +# ═════════════════════════════════════════════════════════════════════════════ +# End to end, on a synthetic corpus small enough to hand-check +# ═════════════════════════════════════════════════════════════════════════════ +@pytest.fixture +def tiny_corpus(tmp_path, monkeypatch): + """Two FP candidates and two control queries, wired through every file the CLI reads.""" + fp_root = tmp_path / "fp" + ctrl_root = tmp_path / "ctrl" + fp_ids = ["GCA_1:c1:0:10-20", "GCA_2:c1:0:10-20"] + from tbox_finder.mining.architecture_producer import candidate_msa_path + + for cid, (ss, row) in zip( + fp_ids, [(SS_TWO_HELIX, ROW_WITH_UG), (SS_ONE_HELIX, ROW_ONE_HELIX)], strict=True + ): + write_consensus(fp_root, candidate_msa_path(fp_root, cid).parent.name, ss, row) + ctrl_ids = [Q_A1, Q_A2] + for cid, (ss, row) in zip( + ctrl_ids, [(SS_TWO_HELIX, ROW_WITH_UG), (SS_ONE_HELIX, ROW_ONE_HELIX)], strict=True + ): + write_consensus(ctrl_root, candidate_msa_path(ctrl_root, cid).parent.name, ss, row) + + manifest = tmp_path / "manifest.json" + manifest.write_text(json.dumps({"candidates": [{"candidate_id": c} for c in fp_ids]})) + inputs = tmp_path / "inputs.json" + inputs.write_text( + json.dumps( + { + "rows": [ + {"candidate_id": c, **evidence_row(STATUS_FAILED, STATUS_FAILED)} + for c in fp_ids + ] + } + ) + ) + ctrl_status = tmp_path / "ctrl_status.json" + ctrl_status.write_text(json.dumps({"status": dict.fromkeys(ctrl_ids, STATUS_FAILED)})) + ctrl_manifest = control_manifest(tmp_path, ctrl_ids) + + fp_report = tmp_path / "fp_report.json" + fp_report.write_text( + json.dumps( + { + "supply": { + "supply_digest_sha256": apm.supply_digest(apm.read_supply(fp_root)), + "supply_origin": "two.amlab:$HOME/somewhere", + } + } + ) + ) + ctrl_report = tmp_path / "ctrl_report.json" + ctrl_report.write_text( + json.dumps( + { + "supply": { + "supply_digest_sha256": apm.supply_digest(apm.read_supply(ctrl_root)), + "supply_origin": "two.amlab:$HOME/elsewhere", + } + } + ) + ) + comparison = tmp_path / "comparison.json" + comparison.write_text( + json.dumps( + { + "headline": {"reading": "carried forward"}, + # The comparison's own statement of WHICH two arms it read, bound to the + # supplies here the same way the two measurement reports are. + "arms": { + "fp": {"supply_digest_sha256": apm.supply_digest(apm.read_supply(fp_root))}, + "control": { + "supply_digest_sha256": apm.supply_digest(apm.read_supply(ctrl_root)) + }, + }, + } + ) + ) + return { + "fp_msa_root": fp_root, + "control_msa_root": ctrl_root, + "fp_manifest_path": manifest, + "spare_rule_inputs_path": inputs, + "control_status_path": ctrl_status, + "control_manifest_path": ctrl_manifest, + "fp_report_path": fp_report, + "control_report_path": ctrl_report, + "comparison_report_path": comparison, + } + + +def test_recommend_runs_end_to_end_and_recommends_a_floor_clearing_setting(tiny_corpus): + body = rec.recommend(**tiny_corpus) + assert body["pins_nothing"] is True + assert rec.clears_all_floors(apm.ParamTuple(label="chosen", **body["recommendation"]["params"])) + assert body["grid"]["n_admissible"] < body["grid"]["n_points_enumerated"] + assert body["grid"]["n_refused_by_the_shipped_localizer"] > 0 + assert body["arms"]["comparison_headline_carried_forward"] == "carried forward" + + +def test_recommend_refuses_a_supply_the_committed_report_does_not_describe(tiny_corpus): + """The digest is the only thing binding a cluster-only supply to a public report.""" + report = Path(tiny_corpus["fp_report_path"]) + report.write_text(json.dumps({"supply": {"supply_digest_sha256": "0" * 64}})) + with pytest.raises(rec.RecommendError, match="different supply"): + rec.recommend(**tiny_corpus) + + +def test_recommend_refuses_a_control_supply_that_is_not_criterion_as_decided_set(tiny_corpus): + """The CONTROL call site of the decided-set guard, driven through `recommend`. + + The guard's unit tests only ever pass label "FP", and the fixture makes the FP arm's + two id sets identical, so deleting either call site left the suite green. Here the + control table calls one query `unavailable` while its consensus sits on disk. + """ + p = Path(tiny_corpus["control_status_path"]) + status = json.loads(p.read_text())["status"] + status[sorted(status)[0]] = STATUS_UNAVAILABLE + p.write_text(json.dumps({"status": status})) + with pytest.raises(rec.RecommendError, match="control supply is not criterion"): + rec.recommend(**tiny_corpus) + + +def test_recommend_refuses_a_consensus_whose_slug_has_no_manifest_candidate(tiny_corpus, tmp_path): + """The orphan check, driven through `recommend` — deleting it left the suite green. + + A consensus the manifest does not name means the supply and the manifest describe + different corpora; the digests are re-stamped here so the *earlier* binding gate + passes and this guard is the one under test. + """ + from tbox_finder.mining.architecture_producer import candidate_msa_path + + ctrl_root = Path(tiny_corpus["control_msa_root"]) + write_consensus( + ctrl_root, + candidate_msa_path(ctrl_root, "zzz:c0:0:10-20").parent.name, + SS_TWO_HELIX, + ROW_WITH_UG, + ) + digest = apm.supply_digest(apm.read_supply(ctrl_root)) + report = Path(tiny_corpus["control_report_path"]) + body = json.loads(report.read_text()) + body["supply"]["supply_digest_sha256"] = digest + report.write_text(json.dumps(body)) + comparison = Path(tiny_corpus["comparison_report_path"]) + cmp_body = json.loads(comparison.read_text()) + cmp_body["arms"]["control"]["supply_digest_sha256"] = digest + comparison.write_text(json.dumps(cmp_body)) + with pytest.raises(rec.RecommendError, match="resolve to no manifest"): + rec.recommend(**tiny_corpus) + + +def test_recommend_names_the_control_status_file_in_a_status_refusal(tiny_corpus): + """The WIRING of the path, not the helper: the kwarg is droppable in silence. + + ``control_records`` takes ``status_path`` keyword-only with a default, so removing it + from the call site leaves the refusal firing — pointing at ``control_manifest.json``, + a file whose contents are fine ([[artifact-pinning-test-cannot-see-the-code]]). + """ + p = Path(tiny_corpus["control_status_path"]) + status = json.loads(p.read_text())["status"] + status[sorted(status)[0]] = "faled" + p.write_text(json.dumps({"status": status})) + with pytest.raises(rec.RecommendError, match="ctrl_status.json"): + rec.recommend(**tiny_corpus) + + +def test_recommend_refuses_a_comparison_report_about_other_supplies(tiny_corpus): + """The headline is a READING of two arms; the file hash identifies only the file. + + Every other number in the payload is bound to the supplies on disk by digest. The + carried-forward sentence was not, so a comparison of a different pair of arms could be + quoted beside them ([[gate-must-bind-to-upstream-evidence]]). + """ + comparison = json.loads(Path(tiny_corpus["comparison_report_path"]).read_text()) + comparison["arms"]["control"]["supply_digest_sha256"] = "0" * 64 + Path(tiny_corpus["comparison_report_path"]).write_text(json.dumps(comparison)) + with pytest.raises(rec.RecommendError, match="reading of different arms"): + rec.recommend(**tiny_corpus) + + +@pytest.mark.parametrize( + "headline", + [ + pytest.param("the FP arm loses more", id="a_string"), + pytest.param(["a"], id="a_list"), + pytest.param(3, id="a_number"), + ], +) +def test_recommend_refuses_a_comparison_report_whose_headline_is_not_an_object( + tiny_corpus, headline +): + """The round-8 guard bound `arms`; the field it protects was still an unguarded `.get`. + + `comparison.get("headline", {})` substitutes its default only when the key is ABSENT, + so a present-but-not-an-object value reached `.get` and raised `AttributeError` — + outside `main`'s except tuple, i.e. a traceback where a refusal was intended, the very + escape `read_manifest_ids` was written to close. + """ + p = Path(tiny_corpus["comparison_report_path"]) + body = json.loads(p.read_text()) + body["headline"] = headline + p.write_text(json.dumps(body)) + with pytest.raises(rec.RecommendError, match="'headline' is"): + rec.recommend(**tiny_corpus) + + +def test_a_headline_block_that_is_simply_absent_is_not_an_error(tiny_corpus): + """Positive control: ABSENT stays permissive — only a wrong SHAPE is refused.""" + p = Path(tiny_corpus["comparison_report_path"]) + body = json.loads(p.read_text()) + del body["headline"] + p.write_text(json.dumps(body)) + assert rec.recommend(**tiny_corpus)["arms"]["comparison_headline_carried_forward"] is None + + +@pytest.mark.parametrize("key", ["fp_report_path", "control_report_path"]) +def test_recommend_refuses_a_measurement_report_that_is_not_an_object(tiny_corpus, key): + """A report file holding a list or a scalar refuses instead of tracebacking. + + The digest binding is the ONLY thing tying a cluster-only supply to a committed public + report, so it must fail by name. + """ + Path(tiny_corpus[key]).write_text(json.dumps([{"supply": {}}])) + with pytest.raises(rec.RecommendError, match="must be a JSON object"): + rec.recommend(**tiny_corpus) + + +def test_recommend_refuses_a_report_whose_supply_block_is_not_an_object(tiny_corpus): + """`.get("supply", {})` defaulted only for an ABSENT key; a truthy scalar reached `.get`.""" + Path(tiny_corpus["fp_report_path"]).write_text(json.dumps({"supply": "cluster"})) + with pytest.raises(rec.RecommendError, match="'supply' is"): + rec.recommend(**tiny_corpus) + + +def test_a_null_supply_block_is_refused_by_the_digest_gate_not_the_shape_gate(tiny_corpus): + """`null` takes `object_field`'s permissive branch, so the DIGEST guard is what refuses. + + Named for the guard that actually fires: a report with no supply block records no + digest, `recorded` is None, and the binding gate says so. Asserting the shape message + here would have pinned a branch this input never reaches. + """ + Path(tiny_corpus["fp_report_path"]).write_text(json.dumps({"supply": None})) + with pytest.raises(rec.RecommendError, match="different supply"): + rec.recommend(**tiny_corpus) + + +def test_recommend_refuses_a_comparison_report_that_records_no_digest(tiny_corpus): + """Absent binds nothing: read as "no disagreement found" it is a vacuous pass.""" + Path(tiny_corpus["comparison_report_path"]).write_text( + json.dumps({"headline": {"reading": "carried forward"}}) + ) + with pytest.raises(rec.RecommendError, match="no 'arms' block"): + rec.recommend(**tiny_corpus) + + +def test_recommend_refuses_a_supply_origin_that_leaks_a_local_path(tiny_corpus): + with pytest.raises(rec.RecommendError, match="local absolute path"): + rec.recommend(**tiny_corpus, supply_origin="/home/someone/tbox-scratch/msa") + + +def test_recommend_accepts_a_cluster_shaped_supply_origin(tiny_corpus): + """Positive control: the refusal above is about the SHAPE, not about the flag.""" + body = rec.recommend(**tiny_corpus, supply_origin="two.amlab:$HOME/tbox-scratch/msa") + assert body["pins_nothing"] is True + + +def test_the_yield_at_the_recommendation_never_exceeds_the_ceiling(tiny_corpus): + """The relation the whole argument rests on, asserted on real derived numbers.""" + body = rec.recommend(**tiny_corpus) + ceiling = body["yield_ceiling"]["by_stage2_threshold"]["stage2_not_declared"] + mined = body["recommendation"]["measured"]["round_yield_n_mined"]["stage2_not_declared"] + assert mined <= ceiling["max_mined_if_b_failed_everywhere"] + assert mined >= ceiling["min_mined_if_b_passed_everywhere"] + assert len(body["recommendation"]["mined_candidate_ids"]) == mined + + +def test_every_frontier_yield_is_within_the_ceiling(tiny_corpus): + body = rec.recommend(**tiny_corpus) + ceiling = body["yield_ceiling"]["by_stage2_threshold"]["stage2_not_declared"][ + "max_mined_if_b_failed_everywhere" + ] + for row in body["frontier_all_admissible"]: + assert row["n_mined"] <= ceiling + + +# ═════════════════════════════════════════════════════════════════════════════ +# The locus — the FP arm's independent unit (review round 3) +# ═════════════════════════════════════════════════════════════════════════════ +def test_two_tiling_windows_calling_the_same_span_are_one_locus(): + """The defect this exists to fix: 79 of 278 FP 'candidates' were second calls.""" + a = "GCA_1.1:c106:15360:16034-16111" + b = "GCA_1.1:c106:15872:16034-16111" + assert rec.locus_of(a) == rec.locus_of(b) == "GCA_1.1:c106:16034-16111" + + +def test_different_spans_on_one_contig_are_different_loci(): + """Positive control: locus_of must not collapse everything to the contig.""" + assert rec.locus_of("GCA_1.1:c106:15360:100-200") != rec.locus_of("GCA_1.1:c106:15360:300-400") + + +def test_an_id_that_is_not_locus_shaped_is_refused_not_guessed(): + with pytest.raises(rec.RecommendError, match="cannot be derived"): + rec.locus_of("not:a:locus") + + +def test_the_decided_states_come_from_the_shipped_status_constants(): + assert rec.DECIDED_STATES == (STATUS_PASSED, STATUS_FAILED) + + +# ═════════════════════════════════════════════════════════════════════════════ +# The §7 axis: every min_named_helices level, priced +# ═════════════════════════════════════════════════════════════════════════════ +def test_every_min_named_helices_level_is_priced(): + grid = [ + point(params=apm.ParamTuple(f"m{m}", 1, m, 2, 2, 50, 2, False), fp_failed=10 * m, mined=m) + for m in (2, 3, 4) + ] + out = rec.selection_by_min_named_helices(grid) + levels = {r["min_named_helices"]: r for r in out["levels"]} + assert set(levels) == set(rec.MIN_NAMED_HELICES_LEVELS) + for m in (2, 3, 4): + assert levels[m]["selection"]["min_named_helices"] == m + assert levels[m]["round_yield_n_mined"] == m + + +def test_a_level_the_rule_cannot_decide_is_reported_not_skipped(): + tied = [ + point(params=apm.ParamTuple("a", 1, 2, 2, 2, 50, 2, False), fp_failed=10), + point(params=apm.ParamTuple("b", 1, 2, 3, 2, 50, 2, False), fp_failed=10), + ] + levels = {r["min_named_helices"]: r for r in rec.selection_by_min_named_helices(tied)["levels"]} + assert levels[2]["selection"] is None + assert levels[2]["the_rule_cannot_decide_at_this_level"] + + +def test_the_two_supported_readings_are_both_carried(): + assert "plural" in rec.MIN_NAMED_HELICES_READINGS[2].lower() + assert "canonical" in rec.MIN_NAMED_HELICES_READINGS[3].lower() + assert "named_elements_present" in rec.MIN_NAMED_HELICES_READINGS[3] + + +# ═════════════════════════════════════════════════════════════════════════════ +# Tie-break honesty, and the origin guard +# ═════════════════════════════════════════════════════════════════════════════ +def test_a_single_valued_tie_break_axis_is_reported_as_unable_to_fire(): + grid = [ + point(params=apm.ParamTuple("a", 1, 2, 2, 2, 50, 2, False)), + point(params=apm.ParamTuple("b", 1, 2, 2, 2, 20, 2, True)), + ] + out = rec.tie_break_exercised(grid) + assert out["can_fire"]["stem_i_nt_threshold"] is False, "one value on the swept grid" + assert out["can_fire"]["allow_wobble"] is True + assert out["can_fire"]["bulge_max_nt"] is True + + +def test_an_origin_carried_from_another_report_clears_the_same_guard_as_the_flag(): + with pytest.raises(rec.RecommendError, match="local absolute path"): + rec.checked_origin("fp", "/home/someone/tbox-scratch/msa") + + +def test_a_cluster_shaped_origin_is_carried_forward(): + """Positive control: the guard is about the shape, not about carrying origins at all.""" + assert rec.checked_origin("fp", "two.amlab:$HOME/tbox-scratch/msa").startswith("two.amlab") + assert rec.checked_origin("fp", None) is None + + +def test_evaluate_point_counts_the_fp_arm_by_locus_not_by_manifest_row(tmp_path): + """Two candidates from overlapping windows on one span must count once, not twice.""" + from tbox_finder.mining.architecture_producer import candidate_msa_path + + fp_root = tmp_path / "fp" + twins = ["GCA_9.1:c7:1024:5000-5100", "GCA_9.1:c7:1536:5000-5100"] + elsewhere = "GCA_9.1:c7:2048:9000-9100" + for cid in [*twins, elsewhere]: + write_consensus( + fp_root, candidate_msa_path(fp_root, cid).parent.name, SS_ONE_HELIX, ROW_ONE_HELIX + ) + items = apm.read_supply(fp_root) + by_slug = {candidate_msa_path(fp_root, c).parent.name: c for c in [*twins, elsewhere]} + # ⚠ ASYMMETRIC ON PURPOSE. `elsewhere` fails (b) but PASSES (a), so a version of + # evaluate_point that drops the (a) conjunct — or reads (c) instead — counts 3 where + # the correct one counts 2. An all-FAILED fixture cannot tell those three apart + # ([[all-true-fixture-cannot-test-a-conjunction]]). + by_id = {c: evidence_row(STATUS_FAILED, STATUS_FAILED) for c in twins} + by_id[elsewhere] = evidence_row(STATUS_PASSED, STATUS_FAILED) + + ctrl_root = tmp_path / "ctrl" + write_consensus( + ctrl_root, candidate_msa_path(ctrl_root, Q_A1).parent.name, SS_TWO_HELIX, ROW_WITH_UG + ) + ctrl_items = apm.read_supply(ctrl_root) + ctrl_status = {Q_A1: STATUS_FAILED} + result = rec.evaluate_point( + CHOSEN, + fp_items=items, + fp_id_by_slug=by_slug, + by_id=by_id, + control_items=ctrl_items, + control_id_by_slug={candidate_msa_path(ctrl_root, Q_A1).parent.name: Q_A1}, + control_status=ctrl_status, + control_record_index={REC_A: [Q_A1]}, + ) + assert result.fp_failed + result.fp_passed == 3, "three manifest rows" + assert result.fp_loci_decided == 2, "the twins are one locus, `elsewhere` another" + assert result.fp_failed == 3, "(b) fails on all three" + assert result.fp_failed_with_a_failed == 2, "only the two whose (a) also failed" + assert result.fp_loci_failing_a_and_b == 1, "and those two are one locus" + # ⚠ The THIRD locus-collapse site. `mined_by_threshold` counts manifest rows and + # `mined_loci_by_threshold` collapses them; nothing asserted the second, so the + # published `round_yield_n_mined_loci` could silently become the row count — the very + # overstatement of "how much DNA" this locus unit exists to prevent. + assert result.mined_by_threshold["stage2_not_declared"] == 2, "both twins are mined rows" + assert result.mined_loci_by_threshold["stage2_not_declared"] == 1, "one piece of DNA" + + +# ═════════════════════════════════════════════════════════════════════════════ +# Review round 4 — both units, and the anchors that must be checked +# ═════════════════════════════════════════════════════════════════════════════ +def test_the_ceiling_is_published_in_loci_as_well_as_manifest_rows(): + """15 rows are 12 loci on the real supply; a row count alone overstates the DNA.""" + twins = ["GCA_9.1:c7:1024:5000-5100", "GCA_9.1:c7:1536:5000-5100"] + by_id = {c: evidence_row(STATUS_FAILED, STATUS_FAILED) for c in twins} + out = rec.yield_ceiling(by_id, ids_with_consensus=twins) + band = out["by_stage2_threshold"]["stage2_not_declared"] + assert band["max_mined_if_b_failed_everywhere"] == 2, "two manifest rows" + assert band["max_mined_if_b_failed_everywhere_loci"] == 1, "one locus" + assert out["distinct_loci_at_the_ceiling"] == 1 + + +def test_an_anchor_is_claimed_only_when_the_digest_actually_matches(tmp_path): + target = tmp_path / "table.json" + target.write_text('{"status": {}}') + report = tmp_path / "report.json" + report.write_text(json.dumps({"provenance": {"extra": {"external_inputs": {"x": "deadbeef"}}}})) + assert ( + rec.anchor_of(target, report, ("provenance", "extra", "external_inputs", "x")) is None + ), "a digest that does not match must not be reported as anchored" + + +def test_an_anchor_is_claimed_when_the_digest_does_match(tmp_path): + """Positive control: anchor_of must be able to say yes, or it is a constant None.""" + target = tmp_path / "table.json" + target.write_text('{"status": {}}') + report = tmp_path / "report.json" + report.write_text( + json.dumps({"provenance": {"extra": {"external_inputs": {"x": rec.sha256_of(target)}}}}) + ) + got = rec.anchor_of(target, report, ("provenance", "extra", "external_inputs", "x")) + assert got and "records this exact digest" in got + + +def test_a_missing_anchor_report_is_not_treated_as_an_anchor(tmp_path): + target = tmp_path / "table.json" + target.write_text("{}") + assert rec.anchor_of(target, tmp_path / "absent.json", ("anything",)) is None + + +def test_the_manifest_coverage_check_is_not_satisfied_by_a_matching_cardinality(): + """A len()==len() degradation passes every equal/missing/extra case a naive test tries.""" + with pytest.raises(rec.RecommendError, match="do not cover|extra"): + rec.assert_covers_manifest({"a": {}, "z": {}}, ["a", "b"]) + + +def test_intervals_disjoint_can_come_out_false(): + """The negative control the flag needs: overlapping arms must read False.""" + overlapping = point(damage=30, producible=68, fp_loci_failing_a_and_b=60, fp_loci_decided=199) + assert rec.anti_selectivity(overlapping)["intervals_disjoint"] is False + + +# ═════════════════════════════════════════════════════════════════════════════ +# Review round 5 — the WRITER validates too, with the reader's own rules +# ═════════════════════════════════════════════════════════════════════════════ +@pytest.mark.parametrize( + "posterior,match", + [ + (True, "non-numeric"), + ("high", "non-numeric"), + (12.5, r"outside \[0, 1\]"), + (-0.1, r"outside \[0, 1\]"), + ], +) +def test_build_inputs_refuses_a_bad_posterior_at_the_join(tmp_path, posterior, match): + """`float(True)` is 1.0 — commit it and the loader can never see it again.""" + cid = "GCA_1.1:c1:0:10-20" + manifest = tmp_path / "m.json" + manifest.write_text(json.dumps({"candidates": [{"candidate_id": cid}]})) + cov = tmp_path / "cov.json" + cov.write_text(json.dumps({"status": {cid: STATUS_FAILED}})) + syn = tmp_path / "syn.json" + syn.write_text(json.dumps({"status": {cid: STATUS_FAILED}})) + post = tmp_path / "p.json" + post.write_text(json.dumps({"posteriors": {cid: posterior}})) + with pytest.raises(rec.RecommendError, match=match): + rec.build_inputs( + covariation_status_path=cov, + synteny_status_path=syn, + stage2_posteriors_path=post, + fp_manifest_path=manifest, + ) + + +def test_build_inputs_refuses_a_bad_status_at_the_join(tmp_path): + cid = "GCA_1.1:c1:0:10-20" + manifest = tmp_path / "m.json" + manifest.write_text(json.dumps({"candidates": [{"candidate_id": cid}]})) + cov = tmp_path / "cov.json" + cov.write_text(json.dumps({"status": {cid: "probably"}})) + syn = tmp_path / "syn.json" + syn.write_text(json.dumps({"status": {cid: STATUS_FAILED}})) + post = tmp_path / "p.json" + post.write_text(json.dumps({"posteriors": {cid: 0.5}})) + with pytest.raises(rec.RecommendError, match="expected one of"): + rec.build_inputs( + covariation_status_path=cov, + synteny_status_path=syn, + stage2_posteriors_path=post, + fp_manifest_path=manifest, + ) + + +def test_the_writer_and_the_reader_apply_the_same_functions(): + """Two copies of the rule is how the writer came to have none of it.""" + import inspect + + writer = inspect.getsource(rec.build_inputs) + reader = inspect.getsource(rec.load_spare_rule_inputs) + for fn in ("checked_status", "checked_posterior"): + assert fn in writer, f"build_inputs must go through {fn}" + assert fn in reader, f"load_spare_rule_inputs must go through {fn}" + + +def test_an_id_with_a_fifth_field_is_refused_not_silently_merged(): + """A fifth field would drop the middle ones and merge two loci into one.""" + with pytest.raises(rec.RecommendError, match="not 4"): + rec.locus_of("GCA_1.1:c1:0:extra:10-20") + + +def test_the_undecidable_axes_are_parameter_keys_only(): + """`^` would admit a vocabulary name that is not a parameter and KeyError in the guard.""" + rec_params = set(CHOSEN.as_dict()) + assert set(rec.TIE_BREAK_VOCABULARY) <= rec_params, "today they are all parameters" + a = point(params=apm.ParamTuple("a", 1, 2, 2, 2, 50, 2, False), fp_failed=10) + b = point(params=apm.ParamTuple("b", 1, 2, 3, 2, 20, 2, False), fp_failed=10) + with pytest.raises(rec.RecommendError, match="min_helix_pairs"): + rec.apply_decision_rule([a, b])