Skip to content

Fix gate selection - #3

Merged
mzueva merged 3 commits into
mainfrom
mzueva/fix-gates
Aug 13, 2026
Merged

Fix gate selection#3
mzueva merged 3 commits into
mainfrom
mzueva/fix-gates

Conversation

@mzueva

@mzueva mzueva commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

This PR changes gate order from a complete ranking of every gate-column value into a selectable binding ladder, filtering unselected gates before validation and scoring. It also updates model validation, UI guidance, documentation, and integration coverage.

Important touched terms

  • Gate order — the weakest-to-strongest ordered gate list; changed from requiring complete coverage to allowing a non-empty selection.
  • Gate scope — the set of gates participating in a run; newly defined by the keys of gateRanks.
  • Gate rank — a selected gate's contiguous one-based position in the binding ladder; ranks now close up after a gate is removed.
  • Retained condition — a non-excluded condition that still has selected-gate rows; conditions represented only by unselected gates are now omitted.
  • Sort fraction — the collected fraction associated with a gate; fractions from unselected gates are now neither required nor included in the condition sum.
  • Gate-rank mean — the read-frequency-weighted mean gate rank for a variant; it is now computed exclusively from selected gates.

Confidence Score: 4/5

The empty-run path should be rejected before merging because stale or unmatched CLI gate selections currently appear to complete successfully without producing any analysis.

The new pre-scoring filter can remove every read before retained conditions are derived, and neither the CLI parameter parser nor pipeline rejects the resulting empty analysis; the UI also lacks an in-place recovery control after removing every gate.

Files Needing Attention: software/src/pipeline.py, ui/src/components/SettingsDrawer.vue

Important Files Changed

Filename Overview
model/src/index.ts Removes complete gate coverage validation, retains non-empty and unknown-gate checks, and derives contiguous ranks from the selected list.
software/src/pipeline.py Introduces selected-gate filtering before validation and scoring, but permits unmatched selections to produce a successful empty run.
software/tests/integration/test_cli.py Adds focused coverage for score isolation, contiguous ranks, condition removal, sort fractions, and replicas outside the selected scope.
ui/src/components/SettingsDrawer.vue Documents gate removal as selection behavior, while conditionally hiding the editor once its final item is removed.
model/src/types.ts Updates the public argument and block-data terminology to define gateRanks and gateOrder as a selected scope.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Reads and gateRanks] --> B[Filter to selected gates]
  B --> C[Derive retained conditions]
  C --> D[Validate samples and sort fractions]
  D --> E[Compute per-condition gate-rank means]
  E --> F[Write score files and manifest]
  B -->|No matching rows| G[Empty retained-condition list]
  G --> H[Successful empty manifest]
Loading

Fix All in Greploop

Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
software/src/pipeline.py:88
**Unmatched gates produce empty success**

When a direct CLI invocation supplies a non-empty `gateRanks` map whose keys match none of the current gate values, `selected_gates` removes every row and the pipeline exits successfully with an empty `conditions` manifest and no score files instead of rejecting the stale selection.

### Issue 2
ui/src/components/SettingsDrawer.vue:154
**Empty selection hides recovery controls**

Removing the final gate makes this `v-if` hide the entire gate-order editor while validation requires at least one gate, forcing the user to clear and reselect the gate column just to restore the list.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "Fix gate selection" | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Context used:

  • Context used - Terms is a types in codebase. Provide the list of ... (source)

Comment thread software/src/pipeline.py
frequencies — but it would otherwise contribute a rank-less term to both sums of the
weighted mean, which is precisely the arithmetic clause 2 confines to collected gates.
"""
return reads.filter(pl.col(COL_GATE).is_in(list(params.gate_ranks)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unmatched gates produce empty success

When a direct CLI invocation supplies a non-empty gateRanks map whose keys match none of the current gate values, selected_gates removes every row and the pipeline exits successfully with an empty conditions manifest and no score files instead of rejecting the stale selection.

Prompt To Fix With AI
This is a comment left during a code review.
Path: software/src/pipeline.py
Line: 88

Comment:
**Unmatched gates produce empty success**

When a direct CLI invocation supplies a non-empty `gateRanks` map whose keys match none of the current gate values, `selected_gates` removes every row and the pipeline exits successfully with an empty `conditions` manifest and no score files instead of rejecting the stale selection.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

of the run, and the ranks close up behind it. Seeded with every value the column
carries, because a run that uses all of them should need no editing. -->

<PlAccordion v-if="app.model.data.gateOrder.length > 0" multiple>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Empty selection hides recovery controls

Removing the final gate makes this v-if hide the entire gate-order editor while validation requires at least one gate, forcing the user to clear and reselect the gate column just to restore the list.

Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/components/SettingsDrawer.vue
Line: 154

Comment:
**Empty selection hides recovery controls**

Removing the final gate makes this `v-if` hide the entire gate-order editor while validation requires at least one gate, forcing the user to clear and reselect the gate column just to restore the list.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@mzueva
mzueva merged commit 5da1182 into main Aug 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant