Skip to content

Fix CID conflicts - #79

Open
mzueva wants to merge 1 commit into
mainfrom
mzueva/fix-library-failure
Open

Fix CID conflicts#79
mzueva wants to merge 1 commit into
mainfrom
mzueva/fix-library-failure

Conversation

@mzueva

@mzueva mzueva commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request resolves MiXCR failures and CIDConflictError by introducing deterministic JSON resource construction and unique template hashes. It adds a canonical-json library to ensure stable CIDs through key-sorted encoding and refactors the reference library routing into a dedicated field. Feedback points out that main.tpl.tengo should use the new canonicalJson.jsonResource for the custom reference library to maintain consistency and ensure CID stability.

checksumVersion: 1
}]
referenceLibrary = string(json.encode(library))
referenceLibrary = smart.createJsonResource(library)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

To ensure stable CIDs for the custom reference library, you should use canonicalJson.jsonResource here as well. The library object (defined on line 108) contains maps (e.g., anchorPoints), and using smart.createJsonResource (which uses standard json.encode) will result in non-deterministic byte sequences due to random map iteration order in Tengo/Go. This is consistent with the fixes applied to other params resources in this PR.

referenceLibrary = canonicalJson.jsonResource(library)

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