Fix CIDConflict - #44
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request addresses unstable CIDs by implementing sorted map iteration across several Tengo templates to ensure deterministic output. Additionally, it migrates the model and ui packages from a legacy Vite/vue-tsc build pipeline to @milaboratories/ts-builder and updates various SDK dependencies. Feedback suggests adding explanatory comments to the new iteration logic in import-custom.tpl.tengo and import-qiagen.tpl.tengo to maintain consistency with documentation provided in other workflow files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR fixes unstable Content IDs (CIDs) caused by non-deterministic Tengo map iteration in the import workflow templates, and migrates
model/andui/from the legacyvite + vue-tscbuild pipeline to@milaboratories/ts-builder.for key, file in map/for key, value in mapidiom withfor key in maps.getKeys(map)to guarantee sorted, deterministic iteration — affecting input-file frame registration and column-rename expression ordering.import-immunoSeq.tpl.tengois partially fixed (column mapping only); the input-file loop still usesmaps.forEach, which may reproduce the instability for that format.model/andui/adoptts-builderscripts (build,watch,type-check), standardisedtsconfiginheritance via@milaboratories/ts-configs, and an explicitexportsfield inmodel/package.json; dependency versions across the whole workspace are bumped to the latest SDK releases.Confidence Score: 3/5
The build migration and most workflow fixes are clean, but
import-immunoSeq.tpl.tengoinput-file iteration was not migrated to the sorted pattern, leaving immunoSeq imports potentially still vulnerable to the CID instability this PR targets.The
maps.forEachleft inimport-immunoSeq.tpl.tengofor input-file ordering means the stated goal of the PR is only partially achieved for that format — users who re-import immunoSeq data could still see CID conflicts. The self-alias guard omission inimport-custom.tpl.tengois a narrower risk but could produce a runtime error if a user creates a passthrough mapping.workflow/src/import-immunoSeq.tpl.tengo (input-file loop not migrated to sorted iteration), workflow/src/import-custom.tpl.tengo (missing self-alias guard)
Important Files Changed
maps.getKeyssorted iteration; self-alias guard added to renameExpressions. Core fix is correct and complete.maps.getKeys, but input-file iteration still usesmaps.forEach— diverges from the sorted-iteration pattern applied everywhere else and may still produce unstable CIDs for immunoSeq imports.maps.getKeysiteration. Change is consistent with the fix pattern.maps.getKeys;mapsimport added. Missing the self-alias guard thatimport-commonreceived, which could fail if a user maps a column to its own name.customMappingandcolumnMapping) migrated tomaps.getKeysfor deterministic ordering; minor comment/whitespace cleanup.vite + vite-plugin-dtsto@milaboratories/ts-builder; exports field added; dependencies updated to match newer SDK versions.ts-builder;vue-tsc,vite,@vitejs/plugin-vueremoved;@milaboratories/helpersandts-configsadded.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["inputFiles.inputs()"] --> B{Template} B -->|"import-common / import-qiagen / import-custom"| C["maps.getKeys sorted iteration ✅"] B -->|"import-immunoSeq"| D["maps.forEach non-deterministic ⚠️"] C --> E["Frame IDs stable"] D --> F["Frame IDs potentially unstable"] E --> G["maps.getKeys on columnMapping ✅"] F --> G G --> H["withColumns / filter / aggregate"] H --> I["save chain.tsv"] E --> J["Stable CID ✅"] F -.-> K["CID conflict risk ⚠️"]Comments Outside Diff (1)
workflow/src/import-immunoSeq.tpl.tengo, line 27-34 (link)maps.getKeysEvery other import template in this PR (
import-common,import-qiagen,import-custom) switched fromfor key, file in inputFiles.inputs()tofor key in maps.getKeys(inputMap)to guarantee deterministic ordering.import-immunoSeq.tpl.tengostill usesmaps.forEach, which iterates in hash/insertion order and produces non-deterministic frame IDs, leaving immunoSeq imports exposed to the same unstable-CID problem this PR sets out to fix.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Fix CIDConflict" | Re-trigger Greptile