glitchlings 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {glitchlings-0.1.0 → glitchlings-0.1.1}/.gitignore +2 -0
  2. glitchlings-0.1.1/LICENSE +201 -0
  3. glitchlings-0.1.1/PKG-INFO +429 -0
  4. {glitchlings-0.1.0 → glitchlings-0.1.1}/README.md +8 -4
  5. {glitchlings-0.1.0 → glitchlings-0.1.1}/pyproject.toml +8 -3
  6. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/reduple.py +9 -9
  7. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/rushmore.py +8 -8
  8. glitchlings-0.1.0/.github/workflows/testpypi.yml +0 -38
  9. glitchlings-0.1.0/LICENSE +0 -21
  10. glitchlings-0.1.0/PKG-INFO +0 -244
  11. glitchlings-0.1.0/RELEASE.md +0 -47
  12. {glitchlings-0.1.0 → glitchlings-0.1.1}/.github/workflows/publish.yml +0 -0
  13. {glitchlings-0.1.0 → glitchlings-0.1.1}/MONSTER_MANUAL.md +0 -0
  14. {glitchlings-0.1.0 → glitchlings-0.1.1}/__init__.py +0 -0
  15. {glitchlings-0.1.0 → glitchlings-0.1.1}/dlc/__init__.py +0 -0
  16. {glitchlings-0.1.0 → glitchlings-0.1.1}/dlc/prime.py +0 -0
  17. {glitchlings-0.1.0 → glitchlings-0.1.1}/main.py +0 -0
  18. {glitchlings-0.1.0 → glitchlings-0.1.1}/tests/conftest.py +0 -0
  19. {glitchlings-0.1.0 → glitchlings-0.1.1}/tests/test_gaggle.py +0 -0
  20. {glitchlings-0.1.0 → glitchlings-0.1.1}/tests/test_glitchlings_determinism.py +0 -0
  21. {glitchlings-0.1.0 → glitchlings-0.1.1}/tests/test_parameter_effects.py +0 -0
  22. {glitchlings-0.1.0 → glitchlings-0.1.1}/util/__init__.py +0 -0
  23. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/__init__.py +0 -0
  24. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/core.py +0 -0
  25. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/jargoyle.py +0 -0
  26. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/mim1c.py +0 -0
  27. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/redactyl.py +0 -0
  28. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/scannequin.py +0 -0
  29. {glitchlings-0.1.0 → glitchlings-0.1.1}/zoo/typogre.py +0 -0
@@ -10,3 +10,5 @@ wheels/
10
10
  .venv
11
11
  .python-version
12
12
  uv.lock
13
+
14
+ RELEASE.md
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 osoleve
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,429 @@
1
+ Metadata-Version: 2.4
2
+ Name: glitchlings
3
+ Version: 0.1.1
4
+ Summary: Monsters for your language games.
5
+ Project-URL: Homepage, https://github.com/osoleve/glitchlings
6
+ Project-URL: Repository, https://github.com/osoleve/glitchlings.git
7
+ Project-URL: Issues, https://github.com/osoleve/glitchlings/issues
8
+ Project-URL: Changelog, https://github.com/osoleve/glitchlings/releases
9
+ Author: osoleve
10
+ License: Apache License
11
+ Version 2.0, January 2004
12
+ http://www.apache.org/licenses/
13
+
14
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
15
+
16
+ 1. Definitions.
17
+
18
+ "License" shall mean the terms and conditions for use, reproduction,
19
+ and distribution as defined by Sections 1 through 9 of this document.
20
+
21
+ "Licensor" shall mean the copyright owner or entity authorized by
22
+ the copyright owner that is granting the License.
23
+
24
+ "Legal Entity" shall mean the union of the acting entity and all
25
+ other entities that control, are controlled by, or are under common
26
+ control with that entity. For the purposes of this definition,
27
+ "control" means (i) the power, direct or indirect, to cause the
28
+ direction or management of such entity, whether by contract or
29
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
30
+ outstanding shares, or (iii) beneficial ownership of such entity.
31
+
32
+ "You" (or "Your") shall mean an individual or Legal Entity
33
+ exercising permissions granted by this License.
34
+
35
+ "Source" form shall mean the preferred form for making modifications,
36
+ including but not limited to software source code, documentation
37
+ source, and configuration files.
38
+
39
+ "Object" form shall mean any form resulting from mechanical
40
+ transformation or translation of a Source form, including but
41
+ not limited to compiled object code, generated documentation,
42
+ and conversions to other media types.
43
+
44
+ "Work" shall mean the work of authorship, whether in Source or
45
+ Object form, made available under the License, as indicated by a
46
+ copyright notice that is included in or attached to the work
47
+ (an example is provided in the Appendix below).
48
+
49
+ "Derivative Works" shall mean any work, whether in Source or Object
50
+ form, that is based on (or derived from) the Work and for which the
51
+ editorial revisions, annotations, elaborations, or other modifications
52
+ represent, as a whole, an original work of authorship. For the purposes
53
+ of this License, Derivative Works shall not include works that remain
54
+ separable from, or merely link (or bind by name) to the interfaces of,
55
+ the Work and Derivative Works thereof.
56
+
57
+ "Contribution" shall mean any work of authorship, including
58
+ the original version of the Work and any modifications or additions
59
+ to that Work or Derivative Works thereof, that is intentionally
60
+ submitted to Licensor for inclusion in the Work by the copyright owner
61
+ or by an individual or Legal Entity authorized to submit on behalf of
62
+ the copyright owner. For the purposes of this definition, "submitted"
63
+ means any form of electronic, verbal, or written communication sent
64
+ to the Licensor or its representatives, including but not limited to
65
+ communication on electronic mailing lists, source code control systems,
66
+ and issue tracking systems that are managed by, or on behalf of, the
67
+ Licensor for the purpose of discussing and improving the Work, but
68
+ excluding communication that is conspicuously marked or otherwise
69
+ designated in writing by the copyright owner as "Not a Contribution."
70
+
71
+ "Contributor" shall mean Licensor and any individual or Legal Entity
72
+ on behalf of whom a Contribution has been received by Licensor and
73
+ subsequently incorporated within the Work.
74
+
75
+ 2. Grant of Copyright License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ copyright license to reproduce, prepare Derivative Works of,
79
+ publicly display, publicly perform, sublicense, and distribute the
80
+ Work and such Derivative Works in Source or Object form.
81
+
82
+ 3. Grant of Patent License. Subject to the terms and conditions of
83
+ this License, each Contributor hereby grants to You a perpetual,
84
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
85
+ (except as stated in this section) patent license to make, have made,
86
+ use, offer to sell, sell, import, and otherwise transfer the Work,
87
+ where such license applies only to those patent claims licensable
88
+ by such Contributor that are necessarily infringed by their
89
+ Contribution(s) alone or by combination of their Contribution(s)
90
+ with the Work to which such Contribution(s) was submitted. If You
91
+ institute patent litigation against any entity (including a
92
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
93
+ or a Contribution incorporated within the Work constitutes direct
94
+ or contributory patent infringement, then any patent licenses
95
+ granted to You under this License for that Work shall terminate
96
+ as of the date such litigation is filed.
97
+
98
+ 4. Redistribution. You may reproduce and distribute copies of the
99
+ Work or Derivative Works thereof in any medium, with or without
100
+ modifications, and in Source or Object form, provided that You
101
+ meet the following conditions:
102
+
103
+ (a) You must give any other recipients of the Work or
104
+ Derivative Works a copy of this License; and
105
+
106
+ (b) You must cause any modified files to carry prominent notices
107
+ stating that You changed the files; and
108
+
109
+ (c) You must retain, in the Source form of any Derivative Works
110
+ that You distribute, all copyright, patent, trademark, and
111
+ attribution notices from the Source form of the Work,
112
+ excluding those notices that do not pertain to any part of
113
+ the Derivative Works; and
114
+
115
+ (d) If the Work includes a "NOTICE" text file as part of its
116
+ distribution, then any Derivative Works that You distribute must
117
+ include a readable copy of the attribution notices contained
118
+ within such NOTICE file, excluding those notices that do not
119
+ pertain to any part of the Derivative Works, in at least one
120
+ of the following places: within a NOTICE text file distributed
121
+ as part of the Derivative Works; within the Source form or
122
+ documentation, if provided along with the Derivative Works; or,
123
+ within a display generated by the Derivative Works, if and
124
+ wherever such third-party notices normally appear. The contents
125
+ of the NOTICE file are for informational purposes only and
126
+ do not modify the License. You may add Your own attribution
127
+ notices within Derivative Works that You distribute, alongside
128
+ or as an addendum to the NOTICE text from the Work, provided
129
+ that such additional attribution notices cannot be construed
130
+ as modifying the License.
131
+
132
+ You may add Your own copyright statement to Your modifications and
133
+ may provide additional or different license terms and conditions
134
+ for use, reproduction, or distribution of Your modifications, or
135
+ for any such Derivative Works as a whole, provided Your use,
136
+ reproduction, and distribution of the Work otherwise complies with
137
+ the conditions stated in this License.
138
+
139
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
140
+ any Contribution intentionally submitted for inclusion in the Work
141
+ by You to the Licensor shall be under the terms and conditions of
142
+ this License, without any additional terms or conditions.
143
+ Notwithstanding the above, nothing herein shall supersede or modify
144
+ the terms of any separate license agreement you may have executed
145
+ with Licensor regarding such Contributions.
146
+
147
+ 6. Trademarks. This License does not grant permission to use the trade
148
+ names, trademarks, service marks, or product names of the Licensor,
149
+ except as required for reasonable and customary use in describing the
150
+ origin of the Work and reproducing the content of the NOTICE file.
151
+
152
+ 7. Disclaimer of Warranty. Unless required by applicable law or
153
+ agreed to in writing, Licensor provides the Work (and each
154
+ Contributor provides its Contributions) on an "AS IS" BASIS,
155
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
156
+ implied, including, without limitation, any warranties or conditions
157
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
158
+ PARTICULAR PURPOSE. You are solely responsible for determining the
159
+ appropriateness of using or redistributing the Work and assume any
160
+ risks associated with Your exercise of permissions under this License.
161
+
162
+ 8. Limitation of Liability. In no event and under no legal theory,
163
+ whether in tort (including negligence), contract, or otherwise,
164
+ unless required by applicable law (such as deliberate and grossly
165
+ negligent acts) or agreed to in writing, shall any Contributor be
166
+ liable to You for damages, including any direct, indirect, special,
167
+ incidental, or consequential damages of any character arising as a
168
+ result of this License or out of the use or inability to use the
169
+ Work (including but not limited to damages for loss of goodwill,
170
+ work stoppage, computer failure or malfunction, or any and all
171
+ other commercial damages or losses), even if such Contributor
172
+ has been advised of the possibility of such damages.
173
+
174
+ 9. Accepting Warranty or Additional Liability. While redistributing
175
+ the Work or Derivative Works thereof, You may choose to offer,
176
+ and charge a fee for, acceptance of support, warranty, indemnity,
177
+ or other liability obligations and/or rights consistent with this
178
+ License. However, in accepting such obligations, You may act only
179
+ on Your own behalf and on Your sole responsibility, not on behalf
180
+ of any other Contributor, and only if You agree to indemnify,
181
+ defend, and hold each Contributor harmless for any liability
182
+ incurred by, or claims asserted against, such Contributor by reason
183
+ of your accepting any such warranty or additional liability.
184
+
185
+ END OF TERMS AND CONDITIONS
186
+
187
+ APPENDIX: How to apply the Apache License to your work.
188
+
189
+ To apply the Apache License to your work, attach the following
190
+ boilerplate notice, with the fields enclosed by brackets "[]"
191
+ replaced with your own identifying information. (Don't include
192
+ the brackets!) The text should be enclosed in the appropriate
193
+ comment syntax for the file format. We also recommend that a
194
+ file or class name and description of purpose be included on the
195
+ same "printed page" as the copyright notice for easier
196
+ identification within third-party archives.
197
+
198
+ Copyright 2025 osoleve
199
+
200
+ Licensed under the Apache License, Version 2.0 (the "License");
201
+ you may not use this file except in compliance with the License.
202
+ You may obtain a copy of the License at
203
+
204
+ http://www.apache.org/licenses/LICENSE-2.0
205
+
206
+ Unless required by applicable law or agreed to in writing, software
207
+ distributed under the License is distributed on an "AS IS" BASIS,
208
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
+ See the License for the specific language governing permissions and
210
+ limitations under the License.
211
+ License-File: LICENSE
212
+ Keywords: adversarial,data,evaluation,glitch,nlp,text
213
+ Classifier: Development Status :: 3 - Alpha
214
+ Classifier: Intended Audience :: Developers
215
+ Classifier: License :: OSI Approved :: Apache Software License
216
+ Classifier: Operating System :: OS Independent
217
+ Classifier: Programming Language :: Python
218
+ Classifier: Programming Language :: Python :: 3
219
+ Classifier: Programming Language :: Python :: 3.12
220
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
221
+ Classifier: Topic :: Software Development :: Testing
222
+ Requires-Python: >=3.12
223
+ Requires-Dist: confusable-homoglyphs>=3.3.1
224
+ Requires-Dist: datasets>=4.0.0
225
+ Requires-Dist: jellyfish>=1.2.0
226
+ Provides-Extra: dev
227
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
228
+ Provides-Extra: jargoyle
229
+ Requires-Dist: nltk>=3.9.1; extra == 'jargoyle'
230
+ Provides-Extra: prime
231
+ Requires-Dist: verifiers>=0.1.3.post0; extra == 'prime'
232
+ Description-Content-Type: text/markdown
233
+
234
+ #
235
+
236
+ ```plaintext
237
+ .─') _ .─') _
238
+ ( OO) ) ( OO ) )
239
+ ░██████ ░██ ░██ ░██ ░██ ░██ ░██
240
+ ░██ ░██ ░██ ░██ ░██ ░██
241
+ ░██ ░██ ░██░████████ ░███████ ░████████ ░██ ░██░████████ ░████████ ░███████
242
+ ░██ █████ ░██ ░██ ░██ ░██('─.░██ ░██ ░██ ░██ ░██░██ ░██ ░██.─')░██ ░██
243
+ ░██ ██ ░██ ░██ ░██ ░██( OO ) ╱░██ ░██ ░██ ░██░██ ░██ ░██(OO)░██ ░███████
244
+ ░██ ░███ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██░██ ░██ ░██ o░███ ░██
245
+ ░█████░█ ░██ ░██ ░████ ░███████ ░██ ░██ ░██ ░██░██ ░██ ░█████░██ ░███████
246
+ ░██
247
+ ░███████
248
+
249
+ Every language game breeds monsters.
250
+ ```
251
+
252
+ `Glitchlings` are **utilities for corrupting the text inputs to your language models in deterministic, _linguistically principled_** ways.
253
+ Each embodies a different way that documents can be compromised in the wild.
254
+
255
+ If reinforcement learning environments are games, then `Glitchling`s are enemies to breathe new life into old challenges.
256
+
257
+ They do this by breaking surface patterns in the input while keeping the target output intact.
258
+
259
+ Some `Glitchling`s are petty nuisances. Some `Glitchling`s are eldritch horrors.
260
+ Together, they create truly nightmarish scenarios for your language models.
261
+
262
+ After all, what good is general intelligence if it can't handle a little chaos?
263
+
264
+ -_The Curator_
265
+
266
+ ## Quickstart
267
+
268
+ ```python
269
+ pip install -U glitchlings
270
+ ```
271
+
272
+ ```python
273
+ from glitchlings import summon, SAMPLE_TEXT
274
+
275
+ gaggle = summon(["reduple", "mim1c", "typogre", "rushmore"])
276
+ gaggle(SAMPLE_TEXT)
277
+ ```
278
+
279
+ > Onҽ m‎ھ‎rning, wһen Gregor Samƽa woke from trouble𝐝 𝑑reams, he found himself transformed in his bed into a horrible vermin‎٠‎ He l lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightlh domed and divided by arches ino stiff sections. The bedding was adly able to cover it and and seemed ready to slide off any moment. His many legxs, pitifully thin compared with the size of the the rest of him, waved about helplessly ashe looked looked.
280
+
281
+ ## Motivation
282
+
283
+ If your model performs well on a particular task, but not when `Glitchling`s are present, it's a sign that it hasn't actually generalized to the problem.
284
+
285
+ Conversely, training a model to perform well in the presence of the types of perturbations introduced by `Glitchling`s should help it generalize better.
286
+
287
+ ## Your First Battle
288
+
289
+ Summon your chosen `Glitchling` (_or a few, if ya nasty_) and call it on your text or slot it into `Dataset.map(...)`, supplying a seed if desired.
290
+ Some `Glitchling`s may have additional keyword arguments but they will always be optional with what I decide are "reasonable defaults".
291
+ Seed defaults to 151, obviously.
292
+
293
+ Calling a `Glitchling` on a `str` transparently calls `.corrupt(str, ...) -> str`.
294
+ This means that as long as your glitchlings get along logically, they play nicely with one another.
295
+
296
+ When summoned as a `Gaggle`, the `Glitchling`s will automatically order themselves into attack waves, based on the scope of the change they make:
297
+
298
+ 1. Document
299
+ 2. Paragraph
300
+ 3. Sentence
301
+ 4. Word
302
+ 5. Character
303
+
304
+ They're horrible little gremlins, but they're not _unreasonable_.
305
+
306
+ ## Starter 'lings
307
+
308
+ For maintainability reasons, all `Glitchling` have consented to be given nicknames once they're in your care. See the [Monster Manual](MONSTER_MANUAL.md) for a complete bestiary.
309
+
310
+ ### Typogre
311
+
312
+ _What a nice word, would be a shame if something happened to it._
313
+
314
+ > _**Fatfinger.**_ Typogre introduces character-level errors (duplicating, dropping, adding, or swapping) based on the layout of a (currently QWERTY) keyboard.
315
+ >
316
+ > Args
317
+ >
318
+ > - `max_change_rate (float)`: The maximum number of edits to make as a percentage of the length (default: 0.02, 2%).
319
+ > - `preserve_first_last (bool)`: Avoid editing the first and last character of a word (default: False).
320
+ > - `keyboard (str)`: Keyboard layout key-neighbor map to use (default: "CURATOR_QWERTY").
321
+ > - `seed (int)`: The random seed for reproducibility (default: 151).
322
+
323
+ ### Mim1c
324
+
325
+ _Wait, was that...?_
326
+
327
+ > _**Confusion.**_ Mim1c replaces non-space characters with Unicode Confusables, characters that are distinct but would not usually confuse a human reader.
328
+ >
329
+ > Args
330
+ >
331
+ > - `replacement_rate (float)`: The maximum proportion of characters to replace (default: 0.02, 2%).
332
+ > - `classes (list[str] | "all")`: Restrict replacements to these Unicode script classes (default: ["LATIN", "GREEK", "CYRILLIC"]).
333
+ > - `seed (int)`: The random seed for reproducibility (default: 151).
334
+
335
+ ### Scannequin
336
+
337
+ _How can a computer need reading glasses?_
338
+
339
+ > _**OCR Artifacts.**_ Scannequin mimics optical character recognition errors by swapping visually similar character sequences (like rn↔m, cl↔d, O↔0, l/I/1).
340
+ >
341
+ > Args
342
+ >
343
+ > - `error_rate (float)`: The maximum proportion of eligible confusion spans to replace (default: 0.02, 2%).
344
+ > - `seed (int)`: The random seed for reproducibility (default: 151).
345
+
346
+ ### Jargoyle
347
+
348
+ _Uh oh. The worst person you know just bought a thesaurus._
349
+
350
+ > _**Sesquipedalianism.**_ Jargoyle, the insufferable `Glitchling`, replaces nouns with synonyms at random, without regard for connotational or denotational differences.
351
+ >
352
+ > Args
353
+ >
354
+ > - `replacement_rate (float)`: The maximum proportion of words to replace (default: 0.1, 10%).
355
+ > - `part_of_speech`: The WordNet part of speech to target (default: nouns). Accepts `wn.NOUN`, `wn.VERB`, `wn.ADJ`, or `wn.ADV`.
356
+ > - `seed (int)`: The random seed for reproducibility (default: 151).
357
+
358
+ ### Reduple
359
+
360
+ _Did you say that or did I?_
361
+
362
+ > _**Broken Record.**_ Reduple stutters through text by randomly reduplicating words. Like a nervous speaker, it creates natural repetitions that test a model's ability to handle redundancy without losing the thread.
363
+ >
364
+ > Args
365
+ >
366
+ > - `reduplication_rate (float)`: The maximum proportion of words to reduplicate (default: 0.05, 5%).
367
+ > - `seed (int)`: The random seed for reproducibility (default: 151).
368
+
369
+ ### Rushmore
370
+
371
+ _I accidentally an entire word._
372
+
373
+ > _**Hasty Omission.**_ The evil (?) twin of `reduple`, Rushmore moves with such frantic speed that it causes words to simply vanish from existence as it passes.
374
+ >
375
+ > Args
376
+ >
377
+ > - `max_deletion_rate (float)`: The maximum proportion of words to delete (default: 0.01, 1%).
378
+ > - `seed (int)`: The random seed for reproducibility (default: 151).
379
+
380
+ ### Redactyl
381
+
382
+ _Oops, that was my black highlighter._
383
+
384
+ > _**FOIA Reply.**_ Redactyl obscures random words in your document like an NSA analyst with a bad sense of humor.
385
+ >
386
+ > ### Args
387
+ >
388
+ > - `replacement_char (str)`: The character to use for redaction (default: █).
389
+ > - `redaction_rate (float)`: The maximum proportion of words to redact (default: 0.05, 5%).
390
+ > - `merge_adjacent (bool)`: Whether to redact the space between adjacent redacted words (default: False).
391
+ > - `seed (int)`: The random seed for reproducibility (default: 151).
392
+
393
+ ## Field Report: Uncontained Specimens
394
+
395
+ ### _Containment procedures pending_
396
+
397
+ - `ekkokin` substitutes words with homophones (phonetic equivalents).
398
+ - `nylingual` backtranslates portions of text.
399
+ - `glothopper` introduces code-switching effects, blending languages or dialects.
400
+ - `palimpsest` rewrites, but leaves accidental traces of the past.
401
+ - `vesuvius` is an apocryphal `Glitchling` with ties to _[Nosy, aren't we? -The Curator]_
402
+
403
+ ## Apocrypha
404
+
405
+ Cave paintings and oral tradition contain many depictions of strange, otherworldly `Glitchling`s.
406
+ These _Apocryphal `Glitchling`_ are said to possess unique abilities or behaviors.
407
+ If you encounter one of these elusive beings, please document your findings and share them with _The Curator_.
408
+
409
+ ### Reproducible Corruption
410
+
411
+ Every `Glitchling` owns its own independent `random.Random` instance. That means:
412
+
413
+ - No `random.seed(...)` calls touch Python's global RNG.
414
+ - Supplying a `seed` when you construct a `Glitchling` (or when you `summon(...)`) makes its behavior reproducible.
415
+ - Re-running a `Gaggle` with the same master seed and the same input text (_and same external data!_) yields identical corruption output.
416
+ - Corruption functions are written to accept an `rng` parameter internally so that all randomness is centralized and testable.
417
+
418
+ #### Caveats
419
+
420
+ - If you mutate a glitchling's parameters after you've used it (e.g. `typogre.set_param(...)`) the outputs may not be the same as before the change. So don't do that.
421
+
422
+ #### At Wits' End?
423
+
424
+ If you're trying to add a new glitchling and can't seem to make it deterministic, here are some places to look for determinism-breaking code:
425
+
426
+ 1. Search for any direct calls to `random.choice`, `random.shuffle`, or `set(...)` ordering without going through the provided `rng`.
427
+ 2. Ensure you sort collections before shuffling or sampling.
428
+ 3. Make sure indices are chosen from a stable reference (e.g., original text) when applying length‑changing edits.
429
+ 4. Make sure there are enough sort keys to maintain stability.
@@ -3,15 +3,15 @@
3
3
  ```plaintext
4
4
  .─') _ .─') _
5
5
  ( OO) ) ( OO ) )
6
- ░██████ ░██ ░██ ░██ ░██ ░██ ░██
7
- ░██ ░██ ░██ ░██ ░██ ░██
6
+ ░██████ ░██ ░██ ░██ ░██ ░██ ░██
7
+ ░██ ░██ ░██ ░██ ░██ ░██
8
8
  ░██ ░██ ░██░████████ ░███████ ░████████ ░██ ░██░████████ ░████████ ░███████
9
9
  ░██ █████ ░██ ░██ ░██ ░██('─.░██ ░██ ░██ ░██ ░██░██ ░██ ░██.─')░██ ░██
10
10
  ░██ ██ ░██ ░██ ░██ ░██( OO ) ╱░██ ░██ ░██ ░██░██ ░██ ░██(OO)░██ ░███████
11
11
  ░██ ░███ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██░██ ░██ ░██ o░███ ░██
12
12
  ░█████░█ ░██ ░██ ░████ ░███████ ░██ ░██ ░██ ░██░██ ░██ ░█████░██ ░███████
13
- ░██
14
- ░███████
13
+ ░██
14
+ ░███████
15
15
 
16
16
  Every language game breeds monsters.
17
17
  ```
@@ -32,6 +32,10 @@ After all, what good is general intelligence if it can't handle a little chaos?
32
32
 
33
33
  ## Quickstart
34
34
 
35
+ ```python
36
+ pip install -U glitchlings
37
+ ```
38
+
35
39
  ```python
36
40
  from glitchlings import summon, SAMPLE_TEXT
37
41
 
@@ -1,24 +1,26 @@
1
1
  [project]
2
2
  name = "glitchlings"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Monsters for your language games."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
+
7
8
  dependencies = [
8
9
  "confusable-homoglyphs>=3.3.1",
9
10
  "datasets>=4.0.0",
10
11
  "jellyfish>=1.2.0",
11
- "nltk>=3.9.1",
12
12
  ]
13
13
 
14
14
  authors = [
15
15
  { name = "osoleve" }
16
16
  ]
17
+
17
18
  keywords = ["nlp", "text", "adversarial", "data", "evaluation", "glitch"]
19
+
18
20
  classifiers = [
19
21
  "Development Status :: 3 - Alpha",
20
22
  "Intended Audience :: Developers",
21
- "License :: OSI Approved :: MIT License",
23
+ "License :: OSI Approved :: Apache Software License",
22
24
  "Programming Language :: Python",
23
25
  "Programming Language :: Python :: 3",
24
26
  "Programming Language :: Python :: 3.12",
@@ -40,6 +42,9 @@ Changelog = "https://github.com/osoleve/glitchlings/releases"
40
42
  glitchlings = "glitchlings.main:main"
41
43
 
42
44
  [project.optional-dependencies]
45
+ jargoyle = [
46
+ "nltk>=3.9.1",
47
+ ]
43
48
  prime = [
44
49
  "verifiers>=0.1.3.post0",
45
50
  ]
@@ -36,15 +36,15 @@ def reduplicate_words(
36
36
  continue
37
37
 
38
38
  # Only consider actual words for reduplication
39
- if rng.random() < reduplication_rate:
40
- # Check if word has trailing punctuation
41
- match = re.match(r"^(\W*)(.*?)(\W*)$", word)
42
- if match:
43
- prefix, core, suffix = match.groups()
44
- # Reduplicate with a space: "word" -> "word word"
45
- tokens[i] = f"{prefix}{core} {core}{suffix}"
46
- else:
47
- tokens[i] = f"{word} {word}"
39
+ if rng.random() < reduplication_rate:
40
+ # Check if word has trailing punctuation
41
+ match = re.match(r"^(\W*)(.*?)(\W*)$", word)
42
+ if match:
43
+ prefix, core, suffix = match.groups()
44
+ # Reduplicate with a space: "word" -> "word word"
45
+ tokens[i] = f"{prefix}{core} {core}{suffix}"
46
+ else:
47
+ tokens[i] = f"{word} {word}"
48
48
 
49
49
  return "".join(tokens)
50
50
 
@@ -34,14 +34,14 @@ def delete_random_words(
34
34
  continue
35
35
 
36
36
  # Only consider actual words for deletion
37
- if rng.random() < max_deletion_rate:
38
- # Check if word has trailing punctuation
39
- match = re.match(r"^(\W*)(.*?)(\W*)$", word)
40
- if match:
41
- prefix, _, suffix = match.groups()
42
- tokens[i] = f"{prefix.strip()}{suffix.strip()}"
43
- else:
44
- tokens[i] = ""
37
+ if rng.random() < max_deletion_rate:
38
+ # Check if word has trailing punctuation
39
+ match = re.match(r"^(\W*)(.*?)(\W*)$", word)
40
+ if match:
41
+ prefix, _, suffix = match.groups()
42
+ tokens[i] = f"{prefix.strip()}{suffix.strip()}"
43
+ else:
44
+ tokens[i] = ""
45
45
 
46
46
  text = "".join(tokens)
47
47
  text = re.sub(r"\s+([.,;:])", r"\1", text)
@@ -1,38 +0,0 @@
1
- name: Publish to TestPyPI
2
-
3
- on:
4
- push:
5
- branches: [ trunk ]
6
-
7
- jobs:
8
- build-and-publish-testpypi:
9
- if: ${{ secrets.TEST_PYPI_API_TOKEN != '' }}
10
- runs-on: ubuntu-latest
11
- permissions:
12
- contents: read
13
-
14
- steps:
15
- - name: Checkout
16
- uses: actions/checkout@v4
17
-
18
- - name: Set up Python
19
- uses: actions/setup-python@v5
20
- with:
21
- python-version: '3.12'
22
-
23
- - name: Install build tools
24
- run: |
25
- python -m pip install --upgrade pip
26
- python -m pip install build twine
27
-
28
- - name: Build sdist and wheel
29
- run: |
30
- python -m build
31
- working-directory: glitchlings
32
-
33
- - name: Upload to TestPyPI
34
- uses: pypa/gh-action-pypi-publish@release/v1
35
- with:
36
- packages-dir: glitchlings/dist
37
- repository-url: https://test.pypi.org/legacy/
38
- password: ${{ secrets.TEST_PYPI_API_TOKEN }}
glitchlings-0.1.0/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 osoleve
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,244 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: glitchlings
3
- Version: 0.1.0
4
- Summary: Monsters for your language games.
5
- Project-URL: Homepage, https://github.com/osoleve/glitchlings
6
- Project-URL: Repository, https://github.com/osoleve/glitchlings.git
7
- Project-URL: Issues, https://github.com/osoleve/glitchlings/issues
8
- Project-URL: Changelog, https://github.com/osoleve/glitchlings/releases
9
- Author: osoleve
10
- License: MIT License
11
-
12
- Copyright (c) 2025 osoleve
13
-
14
- Permission is hereby granted, free of charge, to any person obtaining a copy
15
- of this software and associated documentation files (the "Software"), to deal
16
- in the Software without restriction, including without limitation the rights
17
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- copies of the Software, and to permit persons to whom the Software is
19
- furnished to do so, subject to the following conditions:
20
-
21
- The above copyright notice and this permission notice shall be included in all
22
- copies or substantial portions of the Software.
23
-
24
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- SOFTWARE.
31
- License-File: LICENSE
32
- Keywords: adversarial,data,evaluation,glitch,nlp,text
33
- Classifier: Development Status :: 3 - Alpha
34
- Classifier: Intended Audience :: Developers
35
- Classifier: License :: OSI Approved :: MIT License
36
- Classifier: Operating System :: OS Independent
37
- Classifier: Programming Language :: Python
38
- Classifier: Programming Language :: Python :: 3
39
- Classifier: Programming Language :: Python :: 3.12
40
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
41
- Classifier: Topic :: Software Development :: Testing
42
- Requires-Python: >=3.12
43
- Requires-Dist: confusable-homoglyphs>=3.3.1
44
- Requires-Dist: datasets>=4.0.0
45
- Requires-Dist: jellyfish>=1.2.0
46
- Requires-Dist: nltk>=3.9.1
47
- Provides-Extra: dev
48
- Requires-Dist: pytest>=8.0.0; extra == 'dev'
49
- Provides-Extra: prime
50
- Requires-Dist: verifiers>=0.1.3.post0; extra == 'prime'
51
- Description-Content-Type: text/markdown
52
-
53
- #
54
-
55
- ```plaintext
56
- .─') _ .─') _
57
- ( OO) ) ( OO ) )
58
- ░██████ ░██ ░██ ░██ ░██ ░██ ░██
59
- ░██ ░██ ░██ ░██ ░██ ░██
60
- ░██ ░██ ░██░████████ ░███████ ░████████ ░██ ░██░████████ ░████████ ░███████
61
- ░██ █████ ░██ ░██ ░██ ░██('─.░██ ░██ ░██ ░██ ░██░██ ░██ ░██.─')░██ ░██
62
- ░██ ██ ░██ ░██ ░██ ░██( OO ) ╱░██ ░██ ░██ ░██░██ ░██ ░██(OO)░██ ░███████
63
- ░██ ░███ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██░██ ░██ ░██ o░███ ░██
64
- ░█████░█ ░██ ░██ ░████ ░███████ ░██ ░██ ░██ ░██░██ ░██ ░█████░██ ░███████
65
- ░██
66
- ░███████
67
-
68
- Every language game breeds monsters.
69
- ```
70
-
71
- `Glitchlings` are **utilities for corrupting the text inputs to your language models in deterministic, _linguistically principled_** ways.
72
- Each embodies a different way that documents can be compromised in the wild.
73
-
74
- If reinforcement learning environments are games, then `Glitchling`s are enemies to breathe new life into old challenges.
75
-
76
- They do this by breaking surface patterns in the input while keeping the target output intact.
77
-
78
- Some `Glitchling`s are petty nuisances. Some `Glitchling`s are eldritch horrors.
79
- Together, they create truly nightmarish scenarios for your language models.
80
-
81
- After all, what good is general intelligence if it can't handle a little chaos?
82
-
83
- -_The Curator_
84
-
85
- ## Quickstart
86
-
87
- ```python
88
- from glitchlings import summon, SAMPLE_TEXT
89
-
90
- gaggle = summon(["reduple", "mim1c", "typogre", "rushmore"])
91
- gaggle(SAMPLE_TEXT)
92
- ```
93
-
94
- > Onҽ m‎ھ‎rning, wһen Gregor Samƽa woke from trouble𝐝 𝑑reams, he found himself transformed in his bed into a horrible vermin‎٠‎ He l lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightlh domed and divided by arches ino stiff sections. The bedding was adly able to cover it and and seemed ready to slide off any moment. His many legxs, pitifully thin compared with the size of the the rest of him, waved about helplessly ashe looked looked.
95
-
96
- ## Motivation
97
-
98
- If your model performs well on a particular task, but not when `Glitchling`s are present, it's a sign that it hasn't actually generalized to the problem.
99
-
100
- Conversely, training a model to perform well in the presence of the types of perturbations introduced by `Glitchling`s should help it generalize better.
101
-
102
- ## Your First Battle
103
-
104
- Summon your chosen `Glitchling` (_or a few, if ya nasty_) and call it on your text or slot it into `Dataset.map(...)`, supplying a seed if desired.
105
- Some `Glitchling`s may have additional keyword arguments but they will always be optional with what I decide are "reasonable defaults".
106
- Seed defaults to 151, obviously.
107
-
108
- Calling a `Glitchling` on a `str` transparently calls `.corrupt(str, ...) -> str`.
109
- This means that as long as your glitchlings get along logically, they play nicely with one another.
110
-
111
- When summoned as a `Gaggle`, the `Glitchling`s will automatically order themselves into attack waves, based on the scope of the change they make:
112
-
113
- 1. Document
114
- 2. Paragraph
115
- 3. Sentence
116
- 4. Word
117
- 5. Character
118
-
119
- They're horrible little gremlins, but they're not _unreasonable_.
120
-
121
- ## Starter 'lings
122
-
123
- For maintainability reasons, all `Glitchling` have consented to be given nicknames once they're in your care. See the [Monster Manual](MONSTER_MANUAL.md) for a complete bestiary.
124
-
125
- ### Typogre
126
-
127
- _What a nice word, would be a shame if something happened to it._
128
-
129
- > _**Fatfinger.**_ Typogre introduces character-level errors (duplicating, dropping, adding, or swapping) based on the layout of a (currently QWERTY) keyboard.
130
- >
131
- > Args
132
- >
133
- > - `max_change_rate (float)`: The maximum number of edits to make as a percentage of the length (default: 0.02, 2%).
134
- > - `preserve_first_last (bool)`: Avoid editing the first and last character of a word (default: False).
135
- > - `keyboard (str)`: Keyboard layout key-neighbor map to use (default: "CURATOR_QWERTY").
136
- > - `seed (int)`: The random seed for reproducibility (default: 151).
137
-
138
- ### Mim1c
139
-
140
- _Wait, was that...?_
141
-
142
- > _**Confusion.**_ Mim1c replaces non-space characters with Unicode Confusables, characters that are distinct but would not usually confuse a human reader.
143
- >
144
- > Args
145
- >
146
- > - `replacement_rate (float)`: The maximum proportion of characters to replace (default: 0.02, 2%).
147
- > - `classes (list[str] | "all")`: Restrict replacements to these Unicode script classes (default: ["LATIN", "GREEK", "CYRILLIC"]).
148
- > - `seed (int)`: The random seed for reproducibility (default: 151).
149
-
150
- ### Scannequin
151
-
152
- _How can a computer need reading glasses?_
153
-
154
- > _**OCR Artifacts.**_ Scannequin mimics optical character recognition errors by swapping visually similar character sequences (like rn↔m, cl↔d, O↔0, l/I/1).
155
- >
156
- > Args
157
- >
158
- > - `error_rate (float)`: The maximum proportion of eligible confusion spans to replace (default: 0.02, 2%).
159
- > - `seed (int)`: The random seed for reproducibility (default: 151).
160
-
161
- ### Jargoyle
162
-
163
- _Uh oh. The worst person you know just bought a thesaurus._
164
-
165
- > _**Sesquipedalianism.**_ Jargoyle, the insufferable `Glitchling`, replaces nouns with synonyms at random, without regard for connotational or denotational differences.
166
- >
167
- > Args
168
- >
169
- > - `replacement_rate (float)`: The maximum proportion of words to replace (default: 0.1, 10%).
170
- > - `part_of_speech`: The WordNet part of speech to target (default: nouns). Accepts `wn.NOUN`, `wn.VERB`, `wn.ADJ`, or `wn.ADV`.
171
- > - `seed (int)`: The random seed for reproducibility (default: 151).
172
-
173
- ### Reduple
174
-
175
- _Did you say that or did I?_
176
-
177
- > _**Broken Record.**_ Reduple stutters through text by randomly reduplicating words. Like a nervous speaker, it creates natural repetitions that test a model's ability to handle redundancy without losing the thread.
178
- >
179
- > Args
180
- >
181
- > - `reduplication_rate (float)`: The maximum proportion of words to reduplicate (default: 0.05, 5%).
182
- > - `seed (int)`: The random seed for reproducibility (default: 151).
183
-
184
- ### Rushmore
185
-
186
- _I accidentally an entire word._
187
-
188
- > _**Hasty Omission.**_ The evil (?) twin of `reduple`, Rushmore moves with such frantic speed that it causes words to simply vanish from existence as it passes.
189
- >
190
- > Args
191
- >
192
- > - `max_deletion_rate (float)`: The maximum proportion of words to delete (default: 0.01, 1%).
193
- > - `seed (int)`: The random seed for reproducibility (default: 151).
194
-
195
- ### Redactyl
196
-
197
- _Oops, that was my black highlighter._
198
-
199
- > _**FOIA Reply.**_ Redactyl obscures random words in your document like an NSA analyst with a bad sense of humor.
200
- >
201
- > ### Args
202
- >
203
- > - `replacement_char (str)`: The character to use for redaction (default: █).
204
- > - `redaction_rate (float)`: The maximum proportion of words to redact (default: 0.05, 5%).
205
- > - `merge_adjacent (bool)`: Whether to redact the space between adjacent redacted words (default: False).
206
- > - `seed (int)`: The random seed for reproducibility (default: 151).
207
-
208
- ## Field Report: Uncontained Specimens
209
-
210
- ### _Containment procedures pending_
211
-
212
- - `ekkokin` substitutes words with homophones (phonetic equivalents).
213
- - `nylingual` backtranslates portions of text.
214
- - `glothopper` introduces code-switching effects, blending languages or dialects.
215
- - `palimpsest` rewrites, but leaves accidental traces of the past.
216
- - `vesuvius` is an apocryphal `Glitchling` with ties to _[Nosy, aren't we? -The Curator]_
217
-
218
- ## Apocrypha
219
-
220
- Cave paintings and oral tradition contain many depictions of strange, otherworldly `Glitchling`s.
221
- These _Apocryphal `Glitchling`_ are said to possess unique abilities or behaviors.
222
- If you encounter one of these elusive beings, please document your findings and share them with _The Curator_.
223
-
224
- ### Reproducible Corruption
225
-
226
- Every `Glitchling` owns its own independent `random.Random` instance. That means:
227
-
228
- - No `random.seed(...)` calls touch Python's global RNG.
229
- - Supplying a `seed` when you construct a `Glitchling` (or when you `summon(...)`) makes its behavior reproducible.
230
- - Re-running a `Gaggle` with the same master seed and the same input text (_and same external data!_) yields identical corruption output.
231
- - Corruption functions are written to accept an `rng` parameter internally so that all randomness is centralized and testable.
232
-
233
- #### Caveats
234
-
235
- - If you mutate a glitchling's parameters after you've used it (e.g. `typogre.set_param(...)`) the outputs may not be the same as before the change. So don't do that.
236
-
237
- #### At Wits' End?
238
-
239
- If you're trying to add a new glitchling and can't seem to make it deterministic, here are some places to look for determinism-breaking code:
240
-
241
- 1. Search for any direct calls to `random.choice`, `random.shuffle`, or `set(...)` ordering without going through the provided `rng`.
242
- 2. Ensure you sort collections before shuffling or sampling.
243
- 3. Make sure indices are chosen from a stable reference (e.g., original text) when applying length‑changing edits.
244
- 4. Make sure there are enough sort keys to maintain stability.
@@ -1,47 +0,0 @@
1
- # Releasing glitchlings to PyPI
2
-
3
- This project is configured to publish to PyPI via GitHub Actions when you push a version tag.
4
-
5
- ## 1) One-time setup
6
-
7
- - Decide publishing auth method:
8
- - Preferred: PyPI Trusted Publishing using OIDC. Enable it for the `glitchlings` project in PyPI and grant the GitHub repo `osoleve/glitchlings` permission.
9
- - Alternative: Create a PyPI token (scoped to the project) and add it as a repository secret `PYPI_API_TOKEN`.
10
- - (Optional) Add `TEST_PYPI_API_TOKEN` if you want automatic TestPyPI uploads on pushes to `trunk`.
11
-
12
- ## 2) Versioning
13
-
14
- - Update `version` in `pyproject.toml`.
15
- - Follow SemVer tags like `v0.1.1`.
16
-
17
- ## 3) Dry-run on TestPyPI (optional)
18
-
19
- - Push to `trunk`. If `TEST_PYPI_API_TOKEN` is set, a wheel and sdist will be uploaded to TestPyPI automatically.
20
-
21
- ## 4) Publish to PyPI
22
-
23
- - Create and push a tag from the repository root:
24
-
25
- ```pwsh
26
- git tag v0.1.1
27
- git push origin v0.1.1
28
- ```
29
-
30
- - The workflow `.github/workflows/publish.yml` will build the package from the `glitchlings/` directory and publish the artifacts to PyPI.
31
-
32
- ## 5) Verify
33
-
34
- - Check the run in GitHub Actions.
35
- - Verify the release on PyPI project page.
36
-
37
- ## Notes
38
-
39
- - The package uses Hatchling and includes a console script `glitchlings` that runs `glitchlings.main:main`.
40
- - Build locally:
41
-
42
- ```pwsh
43
- python -m pip install --upgrade build
44
- python -m build glitchlings
45
- ```
46
-
47
- - If adding new modules, ensure they live under the `glitchlings/` directory so they are included in the wheel.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes