MILAB-6480: migrate resource formula to fluent API (workflow-tengo 6.7.0)#89
Conversation
Bump @platforma-sdk/workflow-tengo 6.6.5 -> 6.7.0 (fluent-only exec.formula) and migrate the analyze exec's RAM sizing from .memFormula(f.clamp(...)) to .resources({ onCPU: { cpu, ram } }). Behavior-preserving: RAM stays clamp(64 GiB + 4*size, 64 GiB, 256 GiB); cpu is the same per-sample count.
There was a problem hiding this comment.
Code Review
This pull request migrates the RAM sizing logic in workflow/src/mixcr-analyze.tpl.tengo to the new fluent exec.formula API introduced in @platforma-sdk/workflow-tengo version 6.7.0. Specifically, it replaces mixcrCmdBuilder.memFormula with mixcrCmdBuilder.resources using the bundled onCPU resource specification. The dependency versions in pnpm-lock.yaml and pnpm-workspace.yaml have been updated accordingly. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…onCPU })
cpu is a plain constant and ram is either a static Advanced-Settings override or a formula carrying .staticFallback, so both paths go through one resources({ onCPU }) call. Resolves on backends without getBlobSize (formula falls back to the 64 GiB floor; constant/static values used as-is).
…RAM formula chain
Bumps
@platforma-sdk/workflow-tengo6.6.5 → 6.7.0(fluent-onlyexec.formula) and migrates the analyze exec's RAM sizing to the new API..memFormula(f.clamp(f.add(f.gib(64), f.mul(f.size("reads"), 4)), f.gib(64), f.gib(256)), { fallback })→.resources({ onCPU: { cpu, ram } })withf.size("reads").times(4).plus(f.gib(64)).between(f.gib(64), f.gib(256)).staticFallback(...).clamp(64 GiB + 4·size, 64 GiB, 256 GiB); CPU is the same per-sample count (stated inonCPUsince the new API bundles cpu with a ram formula).Verified: tengo check clean, full block build passes (10/10).
Greptile Summary
This PR migrates the MiXCR analyze exec's resource-sizing from the older imperative
.cpu()/.mem()/.memFormula()calls to the new fluent.resources({ onCPU: { cpu, ram } })API introduced in@platforma-sdk/workflow-tengo6.7.0, while also bumping@platforma-sdk/block-toolsto 2.12.0.clamp(64 GiB + 4·size("reads"), 64 GiB, 256 GiB)— the oldf.clamp(f.add(f.gib(64), f.mul(f.size("reads"), 4)), ...)is rewritten as the fluent chain.times(4).plus(f.gib(64)).between(f.gib(64), f.gib(256)).staticFallback("64GiB"), which is mathematically identical.perProcessCPUs ?? 16logic is now expressed inline via a ternary inside theonCPUobject rather than as a separate.cpu()branch.perProcessMemGBis set,ramis assigned a plain string (e.g.,"128GiB") and passed directly intoonCPU.ram, matching the old.mem()behavior.Confidence Score: 5/5
Straightforward API migration — the RAM formula, CPU default, and static override paths all produce the same effective resource requests as before.
The only changed logic is in the tengo template: the formula chain is reordered (addition is commutative), the fallback is moved from an option object to a fluent call, and CPU is folded into the same resources() call. No branching paths change and no values are dropped. The lockfile additions are consistent with the declared version bumps and carry no unexpected transitive concerns.
No files require special attention.
Important Files Changed
.cpu()/.mem()/.memFormula()calls to the new.resources({ onCPU: { cpu, ram } })fluent API; RAM formula and CPU values are behaviorally equivalent to the old code.@platforma-sdk/workflow-tengo6.6.5→6.7.0 and@platforma-sdk/block-tools2.11.9→2.12.0 in the workspace catalog.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[mixcr-analyze.tpl.tengo] --> B{perProcessMemGB set?} B -- yes --> C["ram = string(perProcessMemGB) + 'GiB'\n(static override)"] B -- no --> D["f.size('reads').times(4)\n.plus(f.gib(64))\n.between(f.gib(64), f.gib(256))\n.staticFallback('64GiB')"] E{perProcessCPUs set?} -- yes --> F[cpu = perProcessCPUs] E -- no --> G[cpu = 16] C --> H D --> H F --> H G --> H H["mixcrCmdBuilder.resources({ onCPU: { cpu, ram } })"]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[mixcr-analyze.tpl.tengo] --> B{perProcessMemGB set?} B -- yes --> C["ram = string(perProcessMemGB) + 'GiB'\n(static override)"] B -- no --> D["f.size('reads').times(4)\n.plus(f.gib(64))\n.between(f.gib(64), f.gib(256))\n.staticFallback('64GiB')"] E{perProcessCPUs set?} -- yes --> F[cpu = perProcessCPUs] E -- no --> G[cpu = 16] C --> H D --> H F --> H G --> H H["mixcrCmdBuilder.resources({ onCPU: { cpu, ram } })"]Reviews (1): Last reviewed commit: "MILAB-6480: fix Tengo parse error — use ..." | Re-trigger Greptile