From 19330889555798a5f866aaa124492595d0e3f401 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 26 Jul 2026 10:51:11 +0000 Subject: [PATCH 1/4] Add micropython-hardware to cloud workspace setup. Clone the board-config/driver repo under /agent/repos, link it at ~/gh/pydevices/micropython-hardware, and list it in repositoryDependencies so Cloud Agent installs get token scope and a local checkout. Co-authored-by: Brad Barnett --- .cursor/environment.json | 1 + AGENTS.md | 15 ++++++++------- scripts/cloud-workspace-install.sh | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.cursor/environment.json b/.cursor/environment.json index 43efd9c..c021809 100644 --- a/.cursor/environment.json +++ b/.cursor/environment.json @@ -10,6 +10,7 @@ "github.com/PyDevices/lv_circuitpython_mod", "github.com/PyDevices/lv_cpython_mod", "github.com/PyDevices/lv_micropython_cmod", + "github.com/PyDevices/micropython-hardware", "github.com/PyDevices/palettes", "github.com/PyDevices/pdwidgets", "github.com/PyDevices/pydisplay", diff --git a/AGENTS.md b/AGENTS.md index f62fbfb..e9dc198 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,13 +37,14 @@ handing work from Cursor desktop to Cloud Agents. ``` /home/ubuntu/gh/ └── pydevices/ - ├── cmods -> /agent/repos/cmods - ├── dotgithub -> /agent/repos/.github (this repo) - ├── PyDevices.github.io -> /agent/repos/PyDevices.github.io - ├── palettes -> /agent/repos/palettes - ├── pdwidgets -> /agent/repos/pdwidgets - ├── pydisplay -> /agent/repos/pydisplay - └── pydisplay_android -> /agent/repos/pydisplay_android + ├── cmods -> /agent/repos/cmods + ├── dotgithub -> /agent/repos/.github (this repo) + ├── micropython-hardware -> /agent/repos/micropython-hardware + ├── PyDevices.github.io -> /agent/repos/PyDevices.github.io + ├── palettes -> /agent/repos/palettes + ├── pdwidgets -> /agent/repos/pdwidgets + ├── pydisplay -> /agent/repos/pydisplay + └── pydisplay_android -> /agent/repos/pydisplay_android ``` **Not cloned locally:** `micropython-lib` — GitHub Actions owns sync and diff --git a/scripts/cloud-workspace-install.sh b/scripts/cloud-workspace-install.sh index bf8ff93..57f57cb 100755 --- a/scripts/cloud-workspace-install.sh +++ b/scripts/cloud-workspace-install.sh @@ -22,6 +22,7 @@ SIBLINGS=( lv_circuitpython_mod lv_cpython_mod lv_micropython_cmod + micropython-hardware palettes pdwidgets pydisplay @@ -234,6 +235,7 @@ clone_missing_siblings || die "one or more sibling clones failed" link_pydevices cmods "$REPOS/cmods" link_pydevices dotgithub "$REPOS/.github" link_pydevices PyDevices.github.io "$REPOS/PyDevices.github.io" +link_pydevices micropython-hardware "$REPOS/micropython-hardware" link_pydevices palettes "$REPOS/palettes" link_pydevices pdwidgets "$REPOS/pdwidgets" link_pydevices pydisplay "$REPOS/pydisplay" From c8929c6d00211ac79dfbbbfd4c8ec77a4cd3e069 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 26 Jul 2026 11:22:02 +0000 Subject: [PATCH 2/4] Point sibling PYTHONPATH at lib/ and document graphics dual products. cloud-python-deps writes palettes/lib, pdwidgets/lib, and graphics/lib into pydevices_siblings.pth. github-presence notes graphics-cmod + graphics-py. Co-authored-by: Brad Barnett --- github-presence.md | 2 +- scripts/cloud-python-deps.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/github-presence.md b/github-presence.md index c06f2cb..4729101 100644 --- a/github-presence.md +++ b/github-presence.md @@ -69,7 +69,7 @@ keeps the shared org logo. | [lv_bindings](https://github.com/PyDevices/lv_bindings) | LVGL C→binding generator (source of truth for the native cmods) | [pydevices.github.io/lv_bindings](https://pydevices.github.io/lv_bindings/) | | [cmods](https://github.com/PyDevices/cmods) | Workspace that builds/smoke-tests the native-module matrix together | [pydevices.github.io/cmods](https://pydevices.github.io/cmods/) | | [displayif](https://github.com/PyDevices/displayif) | Native display bus/framebuffer modules | [pydevices.github.io/displayif](https://pydevices.github.io/displayif/) | -| [graphics](https://github.com/PyDevices/graphics) | Native FrameBuffer/Area module | [pydevices.github.io/graphics](https://pydevices.github.io/graphics/) | +| [graphics](https://github.com/PyDevices/graphics) | Native (`graphics-cmod`) + pure-Python (`graphics-py`) FrameBuffer/Area | [pydevices.github.io/graphics](https://pydevices.github.io/graphics/) | | [usdl2](https://github.com/PyDevices/usdl2) | Native SDL2 subset for pydisplay's desktop backend | [pydevices.github.io/usdl2](https://pydevices.github.io/usdl2/) | | [lv_micropython_cmod](https://github.com/PyDevices/lv_micropython_cmod) | MicroPython user C module glue for LVGL | [pydevices.github.io/lv_micropython_cmod](https://pydevices.github.io/lv_micropython_cmod/) | | [lv_circuitpython_mod](https://github.com/PyDevices/lv_circuitpython_mod) | CircuitPython integration for LVGL | [pydevices.github.io/lv_circuitpython_mod](https://pydevices.github.io/lv_circuitpython_mod/) | diff --git a/scripts/cloud-python-deps.sh b/scripts/cloud-python-deps.sh index 2c247f5..2907632 100755 --- a/scripts/cloud-python-deps.sh +++ b/scripts/cloud-python-deps.sh @@ -95,7 +95,8 @@ if bin="$(ensure_venv pydisplay)"; then # that `import palettes` / `import pdwidgets` resolve in the example matrix. sp="$("$bin/python" -c 'import site; print(site.getsitepackages()[0])' 2>/dev/null)" if [[ -n "${sp:-}" ]]; then - printf '%s\n%s\n' "$REPOS/palettes/src" "$REPOS/pdwidgets/src" \ + printf '%s\n%s\n%s\n' \ + "$REPOS/palettes/lib" "$REPOS/pdwidgets/lib" "$REPOS/graphics/lib" \ > "$sp/pydevices_siblings.pth" log "wrote $sp/pydevices_siblings.pth" fi From 4c3755d18b8ec7ec949e2b2a63d382eafa6a74b9 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 26 Jul 2026 11:25:26 +0000 Subject: [PATCH 3/4] Document PYDEVICES_GH_TOKEN for sibling-repo PR creation. Cursor's default integration token can push but often cannot open PRs on dependency repos; agents should use the injected PAT via GH_TOKEN. Co-authored-by: Brad Barnett --- .../skills/pydevices-cloud-handoff/SKILL.md | 4 ++++ AGENTS.md | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.cursor/skills/pydevices-cloud-handoff/SKILL.md b/.cursor/skills/pydevices-cloud-handoff/SKILL.md index 0c1f449..a72c6f7 100644 --- a/.cursor/skills/pydevices-cloud-handoff/SKILL.md +++ b/.cursor/skills/pydevices-cloud-handoff/SKILL.md @@ -49,6 +49,10 @@ description: >- - Cloud agent works on a branch; review the PR or check out the branch locally. - **Move to Local** may require an existing local agent for the same repo. +- **Sibling PRs:** the Cursor integration token often cannot open PRs outside + the primary `.github` repo. Agents should use env secret + **`PYDEVICES_GH_TOKEN`** (`export GH_TOKEN="$PYDEVICES_GH_TOKEN"` then + `gh pr create -R PyDevices/ …`). See root **`AGENTS.md`** § GitHub auth. ## If layout looks wrong on the VM diff --git a/AGENTS.md b/AGENTS.md index e9dc198..f9ce124 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -135,6 +135,28 @@ When removing paths under `pydevices/` or `cmods/`, delete **symlinks only** (`rm path` on the link), never `rm -rf` through a symlink into `/agent/repos/*` unless the intent is to destroy an owned repo. +## GitHub auth — opening PRs on sibling repos + +Cloud Agents started from **`PyDevices/.github`** get a Cursor integration +token that can **push** branches into `/agent/repos/*` checkouts, but that +token often **cannot** `createPullRequest` on sibling repos (GraphQL +`Resource not accessible by integration`). `ManagePullRequest` is also bound +to the agent’s primary repo (`.github`), so it will not open PRs on +`graphics`, `pydisplay`, etc. + +**Use the workspace secret `PYDEVICES_GH_TOKEN`** (org/admin PAT, injected into +the environment) when creating or updating PRs on any PyDevices sibling: + +```bash +export GH_TOKEN="$PYDEVICES_GH_TOKEN" +gh pr create -R PyDevices/ --base main --head --title "…" --body "…" +# or: gh pr edit … / gh pr ready … +``` + +Confirm access first if needed: `gh api repos/PyDevices/ --jq .permissions` +should show `"push": true` (and usually `"admin": true`) under that token. +Do **not** rely on the default `gh` login (`cursor` / `ghs_…`) for sibling PRs. + ## Related docs - [cmods AGENTS.md](https://github.com/PyDevices/cmods/blob/main/AGENTS.md) — From b1f77551ec955e1fbd4d14843f9e8a93d33c65d6 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 26 Jul 2026 11:31:48 +0000 Subject: [PATCH 4/4] Include usdl2/lib on cloud sibling path; note usdl2-py in presence doc. Co-authored-by: Brad Barnett --- github-presence.md | 2 +- scripts/cloud-python-deps.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/github-presence.md b/github-presence.md index 4729101..0c3a56b 100644 --- a/github-presence.md +++ b/github-presence.md @@ -70,7 +70,7 @@ keeps the shared org logo. | [cmods](https://github.com/PyDevices/cmods) | Workspace that builds/smoke-tests the native-module matrix together | [pydevices.github.io/cmods](https://pydevices.github.io/cmods/) | | [displayif](https://github.com/PyDevices/displayif) | Native display bus/framebuffer modules | [pydevices.github.io/displayif](https://pydevices.github.io/displayif/) | | [graphics](https://github.com/PyDevices/graphics) | Native (`graphics-cmod`) + pure-Python (`graphics-py`) FrameBuffer/Area | [pydevices.github.io/graphics](https://pydevices.github.io/graphics/) | -| [usdl2](https://github.com/PyDevices/usdl2) | Native SDL2 subset for pydisplay's desktop backend | [pydevices.github.io/usdl2](https://pydevices.github.io/usdl2/) | +| [usdl2](https://github.com/PyDevices/usdl2) | Native (`usdl2`) + pure-Python (`usdl2-py`) SDL2 subset for pydisplay's desktop backend | [pydevices.github.io/usdl2](https://pydevices.github.io/usdl2/) | | [lv_micropython_cmod](https://github.com/PyDevices/lv_micropython_cmod) | MicroPython user C module glue for LVGL | [pydevices.github.io/lv_micropython_cmod](https://pydevices.github.io/lv_micropython_cmod/) | | [lv_circuitpython_mod](https://github.com/PyDevices/lv_circuitpython_mod) | CircuitPython integration for LVGL | [pydevices.github.io/lv_circuitpython_mod](https://pydevices.github.io/lv_circuitpython_mod/) | | [lv_cpython_mod](https://github.com/PyDevices/lv_cpython_mod) | Native CPython LVGL extension (`import lvgl`) | [pydevices.github.io/lv_cpython_mod](https://pydevices.github.io/lv_cpython_mod/) | diff --git a/scripts/cloud-python-deps.sh b/scripts/cloud-python-deps.sh index 2907632..27703d5 100755 --- a/scripts/cloud-python-deps.sh +++ b/scripts/cloud-python-deps.sh @@ -95,8 +95,9 @@ if bin="$(ensure_venv pydisplay)"; then # that `import palettes` / `import pdwidgets` resolve in the example matrix. sp="$("$bin/python" -c 'import site; print(site.getsitepackages()[0])' 2>/dev/null)" if [[ -n "${sp:-}" ]]; then - printf '%s\n%s\n%s\n' \ + printf '%s\n%s\n%s\n%s\n' \ "$REPOS/palettes/lib" "$REPOS/pdwidgets/lib" "$REPOS/graphics/lib" \ + "$REPOS/usdl2/lib" \ > "$sp/pydevices_siblings.pth" log "wrote $sp/pydevices_siblings.pth" fi