Skip to content

feat(python-harness): auto-track dict/set and nested JSON args#130

Merged
mkayander merged 7 commits into
mainfrom
cursor/python-collections-auto-tracking-04a1
Jun 1, 2026
Merged

feat(python-harness): auto-track dict/set and nested JSON args#130
mkayander merged 7 commits into
mainfrom
cursor/python-collections-auto-tracking-04a1

Conversation

@mkayander

@mkayander mkayander commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Summary

Python harness improvements for tracked collections, trees/lists, and readable return values.

Python harness

  • Tracked dict/set/frozenset and inline literal instrumentation (collection_tracker.py, transformer updates)
  • Graph / set / map / array argument validation and deep JSON wrapping in exec.py
  • Readable returns: solution_display.py, compose_run_output in exec.py, __repr__/__str__ on tree/list nodes
  • Pyodide: solution_display.py registered in HARNESS_FILES
  • Tests: test_exec.py, test_tree_utils.py (26 Python unit tests)

CI / install robustness

  • postinstall: GraphQL codegen before Prisma (avoids missing gitignored src/graphql/generated when Prisma fails)
  • pnpm run ci:init: explicit postinstall in GitHub Actions after pnpm install
  • Vercel: ensure-generated-from-install after install when cache skips lifecycle hooks

Verification

  • pnpm test (Vitest + Python harness)
  • pnpm run tsc with SKIP_ENV_VALIDATION=true
Open in Web Open in Cursor 

@vercel

vercel Bot commented Apr 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dstruct Ready Ready Preview, Comment May 28, 2026 9:17pm

cursoragent and others added 7 commits May 28, 2026 21:11
- Add TrackedDict and TrackedSet with callstack frames (map/set arg types)
- Extend AST transformer for {}, set literals, dict/set comprehensions
- Deep-wrap array/matrix/map/object/set arguments from JSON for nested tracking
- Register collection_tracker in Pyodide harness; add unit tests

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
…te args

- TrackedSet.add: use super().__contains__ for membership so no readArrayItem
  frame when rejecting duplicates
- _convert_arg_to_python: require each arg to be a dict (explicit TypeError)
- Remove unused os import from exec.py
- Add regression tests for duplicate add and malformed args list

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
…PIs, docs

- Add TrackedFrozenSet and AST rewrite for frozenset(...) calls
- Deep-wrap graph args like arrays; TypeError if value is not a JSON list
- TrackedDict: setdefault, pop, popitem, clear, update with frame semantics
- TrackedSet: pop, clear; discard/remove avoid spurious read via super
- Document harness contracts in docs/PYTHON_PYODIDE.md
- Extend test_exec for frozenset, graph, dict.clear

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
…exec args

- Restore TrackedDict class boundary broken during rebase; unify frames on
  self._add_frame; add _emit_collection_frame for TrackedFrozenSet.__new__
- exec: null array/matrix -> TrackedList; set/map require list/dict; remove
  silent wrong-type pass-through for map/object

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
Wire safe_exec output through compose_run_output so the UI shows level-order
trees and linked-list chains instead of default object reprs. Add __repr__/
__str__ on instrumented and plain tree/list nodes; dedupe display logic via
tree_utils helpers. Register solution_display.py for Pyodide and add tests.
Rebase follow-up: run GraphQL codegen before Prisma in postinstall so a
Prisma failure does not skip gitignored generated files. Add ci:init for
GitHub Actions, ensure-generated-from-install for Vercel, and document in
AGENTS.md.
@cursor cursor Bot force-pushed the cursor/python-collections-auto-tracking-04a1 branch from 8ffd10a to 65ebd51 Compare May 28, 2026 21:14
@mkayander mkayander merged commit 61c5e23 into main Jun 1, 2026
6 checks passed
github-actions Bot pushed a commit that referenced this pull request Jun 1, 2026
# [1.379.0](v1.378.1...v1.379.0) (2026-06-01)

### Features

* **python-harness:** auto-track dict/set and nested JSON args ([#130](#130)) ([61c5e23](61c5e23))
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.379.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants