Skip to content

Milab-6720: prerun hint and run disabling - #49

Open
erohinaelena wants to merge 8 commits into
mainfrom
MILAB-6720_prerun-hint-and-run-gate
Open

Milab-6720: prerun hint and run disabling#49
erohinaelena wants to merge 8 commits into
mainfrom
MILAB-6720_prerun-hint-and-run-gate

Conversation

@erohinaelena

@erohinaelena erohinaelena commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds prerun progress feedback and gates bare-set imports on identity-collision checks, while extracting the bare-set mapping UI into its own component.

  • Adds source/profile association and identity-specific collision outputs across the Tengo workflow and TypeScript model.
  • Mirrors prerun collision verdicts into block data so argument projection can disable unsafe runs.
  • Clears file-specific mappings when a different file is selected and adds pending/profile feedback.
  • Fixes alert labels, TCR mapping cleanup, property candidates, and empty identity-dropdown presentation.
  • Important touched terms:
    • Bare set — a minimally specified record table mapped through identity and receptor-sequence columns; its form was extracted and its run validation strengthened.
    • Identity collision — one identity appearing on non-identical mapped rows, which would merge records under the identity-derived key; it is now intended to block Run rather than only warn.
    • Prerun check — a whole-input validation performed before import; its verdict is now mirrored into BlockData for argument validation.
    • Column profile — the whole-file description of headers, value types, and amino-acid candidates; it now carries the source sample identity so stale retained profiles can be hidden.
    • Mapped columns — source headers assigned to identity, sequence, and property roles; file-specific mappings are now forgotten when switching files.
    • Numbering scheme — IMGT, Kabat, or Chothia coordinates used for region annotation; labels are now shared from the model and compatible choices survive file changes.

Confidence Score: 4/5

The stale collision-verdict path should be fixed before merging because it can allow an unchecked sequence mapping to import and merge distinct records.

Collision detection depends on the mapped sequence columns, but the persisted verdict survives sequence changes and the run gate validates it using only the unchanged identity-column name.

Files Needing Attention: ui/src/app.ts, model/src/index.ts

Important Files Changed

Filename Overview
model/src/index.ts Adds collision-based argument validation and profile/run-status outputs, but the verdict freshness check covers only identity and can accept results from an older sequence mapping.
model/src/types.ts Adds shared scheme labels, the mirrored prerun-verdict state contract, and a helper that removes file-specific mappings.
ui/src/app.ts Adds progress integration and mirrors prerun verdicts into block data, but fails to clear the verdict while a changed sequence mapping is being rechecked.
ui/src/pages/MainPage.vue Adds file-profile pending feedback, resets mappings on file replacement, and delegates bare-set configuration to a dedicated component.
ui/src/pages/components/BareSetForm.vue Extracts and improves bare-set mapping controls, including TCR cleanup, property filtering, pending validation, and labeled collision warnings.
workflow/src/prerun.tpl.tengo Associates profiles with sample IDs and collision reports with identity columns, though the latter does not identify the complete sequence mapping used by the check.
test/src/wf.test.ts Updates collision-gate and profile-source assertions but does not cover changing sequence mappings while retaining the identity column.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Select file] --> B[Profile columns]
  B --> C[Profile tagged with sample ID]
  C --> D[Map identity and sequence columns]
  D --> E[Prerun collision check]
  E --> F[Mirror verdict into BlockData]
  F --> G{Verdict matches current mapping?}
  G -->|Pending or collision| H[Disable Run]
  G -->|Clear| I[Project workflow arguments]
  I --> J[Import bare-set records]
Loading

Fix all with Greploop Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
ui/src/app.ts:36
**Sequence changes retain stale verdicts**

When a mapped sequence column changes without changing the identity column, this early return preserves the previous collision verdict while prerun recomputes it, and the run gate accepts that verdict based only on the identity name. A previously clean verdict can therefore enable an unchecked mapping and merge distinct same-identity rows into one record; a stale collision verdict can also keep a valid mapping blocked.

---

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

Reviews (1): Last reviewed commit: "MILAB-6720: split the bare-set form out ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used (5)

Picking a file left the panel silent while every column of it was profiled, and
the profile outputs are retentive, so the dropdowns kept answering with the
previous file's headers as though nothing was happening. A mapping that had
passed against that previous file also still satisfied bareSetValid, so Run
stayed live over a file nobody had looked at and over headers it might not have.

Prerun now states which file the profile came from, and the model pairs the two
under retentive: getIsReadyOrError marks the read unstable, so the reported id
stays the old file's until the new scan lands. The panel compares it with the
loaded file, announces the wait, and withholds the mapping until the columns on
offer are really this file's. Keyed to the file rather than to "prerun is busy"
because prerun also re-runs on every mapping edit to re-check the identity
column for collisions.

Picking a different file drops the parts of the mapping that name columns,
keeping the receptor declaration and the numbering scheme. That is what disables
Run, and it is done on the gesture: args is a pure function of data and cannot
consult prerun, and mirroring prerun's verdict back into data is the pattern
this block is shedding. Re-picking the same file is not a swap.

The import itself now shows the block's loader, which it never did, scoped to
the main run so it cannot cover the settings panel during prerun.
PlAlert declares only a default slot and takes its heading from the `label`
prop, so the four `<template #title>` headings in the panel had never rendered.
The bodies showed with nothing above them.
The panel quoted bareSet.identity, which updates on the pick, against
collisions produced for the previous column, so changing an offending column
flashed the old verdict under the new column's name. Prerun now states which
column it checked and the model reports both as one value, so the panel can
tell a current verdict from a stale one.

Also cuts the listed values from ten to three: the list buried the sentence
saying what to do about them.
The record key is the identity's hash, so a value repeated on rows that are not
identical merges two records into one. Prerun found these and the panel warned,
but Run stayed live and the API imported the merged set without complaint.

Run is now refused while the verdict for the selected column is outstanding and
when it says the column repeats, and the panel says which. The platform enforces
it too: invalid args leave no production to render.

The args projection sees only data, and no gesture can capture this fact -- the
scientist picks a column and only then does the check discover whether it is
sound -- so the UI mirrors the verdict in. The rules that keep that safe are
stated on BlockData.prerunChecks for the checks still to come.
Clearing it left the field reading "Value not available" in red. `identity` is a
required string, so "nothing chosen" is stored as "", and a dropdown treats any
non-undefined value as chosen -- "" is a chosen value that is not in the
options. The field now reports nothing chosen.

Also: clearing a mapping only reset it when the mapped chains were the IG pair,
so a TCR mapping could never clear itself.

The message shown while the checks are outstanding is now phrased for the checks
in general rather than naming the id column, since more of them are coming.
Five separate entries for one PR's worth of related work read as five
independent releases in the changelog. One entry, same package list.
MainPage had grown to 1037 lines, over half of it one subject: mapping a file of
bare sequences onto records. That form, the checks that gate it and the numbering
that follows from it now live in pages/components/BareSetForm.vue, leaving
MainPage with the two doors, the dataset-door format mapping and the table (720
lines). The parent still decides whether the shape is being mapped at all -- a
file is loaded and its columns are known -- and passes the header list it already
computes for the other door.

SCHEME_LABELS and forgetMappedColumns move to the model: both are shared with
MainPage, and both are data-shape facts that sit naturally beside CHAIN_SLOT_LABELS
and bareSetValid.

Fixes a latent bug carried along in the move: propertyCandidates excluded only
IGHeavy and IGLight from the property candidates, so a TCR mapping was offered
its own sequence columns as record properties.
Comment thread ui/src/app.ts
// the equality guard means agreeing clients do not write at all.
watchEffect(() => {
const found = model.outputs.identityCollisions;
if (found === undefined) return;

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 Sequence changes retain stale verdicts

When a mapped sequence column changes without changing the identity column, this early return preserves the previous collision verdict while prerun recomputes it, and the run gate accepts that verdict based only on the identity name. A previously clean verdict can therefore enable an unchecked mapping and merge distinct same-identity rows into one record; a stale collision verdict can also keep a valid mapping blocked.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/app.ts
Line: 36

Comment:
**Sequence changes retain stale verdicts**

When a mapped sequence column changes without changing the identity column, this early return preserves the previous collision verdict while prerun recomputes it, and the run gate accepts that verdict based only on the identity name. A previously clean verdict can therefore enable an unchecked mapping and merge distinct same-identity rows into one record; a stale collision verdict can also keep a valid mapping blocked.

**Knowledge Base Used:**
- [Bare repertoire set processing](https://app.greptile.com/milaboratories/-/custom-context/knowledge-base/platforma-open/import-vdj-data/-/docs/bare-set-processing.md)
- [Workflow orchestration and preparation](https://app.greptile.com/milaboratories/-/custom-context/knowledge-base/platforma-open/import-vdj-data/-/docs/workflow-orchestration.md)

---

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

Fix in Claude Code

A collision is not "the id column repeats" -- it is an id repeated on rows whose
other mapped cells differ, so remapping a chain can turn a clean set into a
colliding one and back. Keying the verdict on the id alone meant a chain remap
left the previous verdict standing: a clean one enabled a mapping nothing had
checked and merged distinct rows into one record, and a stale colliding one kept
a valid mapping blocked until prerun caught up.

Prerun now states the identity and the mapped sequence columns it checked, and
one shared rule (collisionCheckKey) decides whether a verdict is about the
current mapping. The panel, the run gate and the mirror all use it, so they
cannot disagree about what "the same mapping" means. Exposed on the facade so the
tests state the verdict with the same rule the gate applies rather than
rebuilding it.
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