Relationships
#3367 codegen: AWS models emit CloudFormation patterns JavaScript cannot compile, so @swamp/aws/chime, glue and transfer fail to import
Opened by skunk-ape · 10/13/2026
Found while verifying #3325. pcreToRegexp in codegen/shared/util.ts translates CloudFormation pattern strings but never checks that the result compiles. Three published AWS extensions throw when their module is imported, so swamp extension pull fails for them and they cannot be used.
Observed (swamp 20261012.194115.0)
- @swamp/aws/chime 2026.10.08.1, channel.ts: Range out of order in character class, from a pattern with astral range escapes that become a surrogate range without the u flag.
- @swamp/aws/glue 2026.10.08.2, session.ts and user_defined_function.ts: Range out of order in character class (surrogate pairs written as a range without the u flag).
- @swamp/aws/transfer 2026.10.08.1, host_key.ts: Invalid property name in character class, for the PCRE class p{Print}, which JavaScript has no equivalent for.
Reproduce: deno eval an import of the model file from the extension directory; or swamp extension pull @swamp/aws/glue, which reports Install partially applied ... bundling/importing the extension failed.
Effect
- The extensions are broken for every user.
- The verify-build upgrade gate fails for any change that bumps these extensions, because it cannot pull the published version (it failed #3325's verification).
Fix direction
- After translation, compile the result with the chosen flags and skip the pattern (return undefined, as the function already does for unsupported subpatterns) when it does not compile; or translate astral ranges with the u flag and map p{Print} to an explicit class.
- Add the three patterns to the util tests.
- Regenerate; the new versions republish working code.
Open
No activity in this phase yet.
skunk-ape commented 10/13/2026, 4:05:13 PM
Note from #3325: @swamp/aws/chime, glue and transfer were left out of the first-party license change because the upgrade gate cannot pull their published versions. When this fix regenerates them, they pick up license: AGPL-3.0-or-later and the or-later source headers from codegen automatically. Confirm all three manifests declare it before merging.
Sign in to post a ripple.