• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / py-slang / 33709168755
86%

Build:
DEFAULT BRANCH: main
Ran 03 Sep 2026 03:02AM UTC
Jobs 1
Files 139
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Sep 2026 02:50AM UTC coverage: 85.684% (+0.01%) from 85.672%
33709168755

push

github

web-flow
fix(py2js): compile the prelude in dual mode so reduce/map/filter callbacks can reach the async spine (#453)

* fix(py2js): compile the prelude in dual mode so a callback threaded through reduce/map/filter can reach the async spine

Group preludes (linked-list.prelude.ts's reduce/_reduce, map/_map,
filter/_filter, ...) were always compiled sync-only: the prelude's own
source never imports anything or calls input(), so there seemed to be no
reason for it to need the async spine even when the program using it does.

That reasoning missed that these are higher-order functions calling a
caller-supplied callback. A sync-compiled function's own calls always
compile to `__py.call`, regardless of how the function itself was invoked -
so reduce's call to its callback stayed pinned to the synchronous
trampoline even when reduce was invoked from a program running on the async
spine. Any module call inside that callback (e.g. a sound-module accessor
taking a Sound argument) then failed with "needs a frontend round-trip and
cannot be called from a synchronous module callback" - not because the
module call itself lacked async support, but because reduce's own internal
dispatch never gave it the chance to use it.

Fixes both places the prelude gets compiled: setupRuntime (the one-shot
REPL API) now compiles it in "dual" mode outright; Py2JsSession's
runChunkInternal (the persistent-session API the conductor evaluator
actually uses) now also treats `compilingPrelude` as a dual-mode trigger,
alongside its existing imports/input() checks.

Motivating case: source-academy/modules#944 - `consecutively(llist(...))`,
which threads sound-module accessor calls through the stdlib's `reduce`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ks2WRhfRjzE6vv5T3UkWeW

* style: run prettier on the new test file

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ks2WRhfRjz... (continued)

4848 of 6084 branches covered (79.68%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

10857 of 12245 relevant lines covered (88.66%)

162929.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 33709168755.1 03 Sep 2026 03:02AM UTC 139
85.68
GitHub Action Run
Source Files on build 33709168755
  • Tree
  • List 139
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #33709168755
  • 50d83b8c on github
  • Prev Build on main (#33252805903)
  • Next Build on main (#33766385549)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc