Infer DS labels from code + argument display names (arg-N) - #128
Open
mkayander wants to merge 18 commits into
Open
Infer DS labels from code + argument display names (arg-N)#128mkayander wants to merge 18 commits into
mkayander wants to merge 18 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cursor
Bot
force-pushed
the
cursor/infer-ds-variable-labels-3270
branch
from
April 23, 2026 19:22
54babea to
7956594
Compare
mkayander
marked this pull request as ready for review
April 23, 2026 19:32
cursor
Bot
force-pushed
the
cursor/infer-ds-variable-labels-3270
branch
from
April 23, 2026 19:53
7956594 to
55d0d43
Compare
cursor
Bot
force-pushed
the
cursor/infer-ds-variable-labels-3270
branch
from
April 23, 2026 22:02
55d0d43 to
5bcccdd
Compare
cursor
Bot
force-pushed
the
cursor/infer-ds-variable-labels-3270
branch
from
May 20, 2026 20:26
5bcccdd to
cf6dc58
Compare
cursor
Bot
force-pushed
the
cursor/infer-ds-variable-labels-3270
branch
from
July 4, 2026 16:14
7f11e9f to
b9e3d56
Compare
cursor
Bot
force-pushed
the
cursor/infer-ds-variable-labels-3270
branch
from
August 1, 2026 18:56
757725c to
a92c658
Compare
- JS: extend array literal transform to call __dstructArrayLiteralWithName for const/assign/assignment-pattern RHS; keep unnamed helper for single-string literals and return-position literals - Runtime: build labeled literals via ControlledArray with displayLabel in addArray options - Redux: store displayLabel on ArrayData; show caption in array/map/matrix views - Python: attach AST parents and infer list names from assign/ann/aug assign; pass displayLabel in TrackedList addArray options; seed case arg labels from arg name Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
- Add optional ArgumentObject.label (non-unique); getArgumentDisplayLabel falls back to arg-{order+1}
- caseSlice.updateArgumentLabel + include label in args content signature
- ArgInput: composite field labels; suffix rename opens Popover with debounced 300ms save + flush on close
- JsonInput: suffixSlot + timeout passthrough; string/json inputs use 300ms debounce
- New projects/cases: short-uuid argument ids instead of head/array keys; addCase binary tree uses uuid
- useArgumentsParsing: structure displayLabel uses display name, not store id
- i18n: rename tooltip strings (en + generated types)
Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
- Extend array literal transform: append { displayLabel } to new Array/ArrayProxy
when RHS is inferable; skip ambiguous new Array(singleNumber) length form
- Require array literal parent to be actual RHS (init/right) for named literals
- ArrayProxy constructor accepts optional trailing options object for displayLabel
Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
Plain array literals do not use ArrayProxy, so DS labels and addArray frames only appear after the AST transform. Apply array literal rewriting whenever parse succeeds, not only when line probes are injected; fall back to transforming all functions if the return-function template is missing. Also recognize ??=/||=/&&= bindings for named literals, inherit displayLabel through Array.map, and always run transformed code in the worker.
- Share buildTrackedArrayFromLiteralElements for named/unnamed literals - Collapse program-wide function traversal into one Babel visitor - Keep runtime display label helper module-private - Align Python ListOptions TypedDict with displayLabel field Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
- Runtime tests: literal helper, map inheritance, plain [] gap, getLevels path - Redux: arraySlice.create and caseSlice.updateArgumentLabel - Args: getArgumentDisplayLabel fallbacks and duplicate labels - AST: transformArrayLiteralsInProgram fallback - Python: inline list literal emits displayLabel in addArray frame - Remove duplicate getLevels file and instrument tests that only checked ok:true Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/infer-ds-variable-labels-3270
branch
from
August 1, 2026 21:22
a92c658 to
577c451
Compare
Transform const nums = new Array() to __dstructArrayLiteralWithName instead
of new Array({ displayLabel }), which ArrayProxy rejected as a sole argument.
Also strip displayLabel-only options when it is the only constructor arg so
legacy transformed code (e.g. addStrings) keeps working.
Route element-style new Array(...) to __dstructArrayLiteralWithName instead of appending displayLabel (avoids constructor edge cases). Keep displayLabel append only for dynamic length forms like new Array(n). Validate all ArrayProxy constructor elements, not just the first.
Tuple literals on the RHS of destructuring (e.g. [a, b] = [b, a]) must stay plain arrays. Tracking them links tracked argument structures as nested children and renders a phantom matrix in the viewer.
Parse JS return-function and Python def signatures to map case arguments to parameter names (num1, num2) by position. Sync editor code to Redux so labels update as the user edits. Explicit arg.label still wins.
- Prefer def solve/run entry points; strip type annotations and defaults - Fall back to saved solution code when editor slice is empty (mobile results) - Add tests for def run, annotations, and language dispatch
Extract getMatrixChildArrayArgs into entities/argument/lib so createRuntimeMatrix no longer imports useArgumentsParsing (which pulls tRPC/Next.js via useSolutionParameterNames). Import stringifySolutionResult from its module path in the worker.
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.
Summary
Infers data-structure display labels from user code (JS + Python) and adds user-facing argument display names with rename UI.
Runtime structure labels
[]/new Array()to tracked helpers with optionaldisplayLabelTrackedListpassesdisplayLabelinaddArrayframesdisplayLabel; array/map/matrix views showStructureDisplayLabelArgument display names
arg.label→ solution parameter name →arg-{order+1}Solution parameter inference (JS + Python)
return function solve(a, b) { … }def solve/def run, strips annotations/defaultseditorCodeSlice; falls back to saved solution (mobile)Production fixes included
new Array()/ArrayProxyhardening (addStrings crash)CI fix (latest)
getMatrixChildArrayArgsout ofuseArgumentsParsingso the worker bundle no longer pulls tRPC/Next.js viauseSolutionParameterNamesTest plan
codeExec.worker.spec.tsesbuild bundle succeedsnum1/num2on args,numson runtime array afterconst nums = new Array()[num1, num2] = [num2, num1]— no phantom matrix