fauxcall 0.1.0__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 (131) hide show
  1. fauxcall-0.1.0/LICENSE +202 -0
  2. fauxcall-0.1.0/PKG-INFO +256 -0
  3. fauxcall-0.1.0/README.md +211 -0
  4. fauxcall-0.1.0/pyproject.toml +216 -0
  5. fauxcall-0.1.0/pyproject.toml.orig +190 -0
  6. fauxcall-0.1.0/src/fauxcall/__init__.py +10 -0
  7. fauxcall-0.1.0/src/fauxcall/__main__.py +6 -0
  8. fauxcall-0.1.0/src/fauxcall/analysis/__init__.py +1 -0
  9. fauxcall-0.1.0/src/fauxcall/analysis/jobs.py +186 -0
  10. fauxcall-0.1.0/src/fauxcall/analysis/profile.py +435 -0
  11. fauxcall-0.1.0/src/fauxcall/analysis/relations.py +220 -0
  12. fauxcall-0.1.0/src/fauxcall/analysis/schema.py +1080 -0
  13. fauxcall-0.1.0/src/fauxcall/analysis/sqlview.py +169 -0
  14. fauxcall-0.1.0/src/fauxcall/analysis/timing.py +189 -0
  15. fauxcall-0.1.0/src/fauxcall/analysis/writes.py +238 -0
  16. fauxcall-0.1.0/src/fauxcall/build/__init__.py +1 -0
  17. fauxcall-0.1.0/src/fauxcall/build/init.py +491 -0
  18. fauxcall-0.1.0/src/fauxcall/build/scaffold.py +842 -0
  19. fauxcall-0.1.0/src/fauxcall/build/templates/fake/Dockerfile.j2 +13 -0
  20. fauxcall-0.1.0/src/fauxcall/build/templates/fake/README.md.j2 +58 -0
  21. fauxcall-0.1.0/src/fauxcall/build/templates/fake/env.example.j2 +13 -0
  22. fauxcall-0.1.0/src/fauxcall/build/templates/fake/fauxcall.toml.j2 +3 -0
  23. fauxcall-0.1.0/src/fauxcall/build/templates/fake/pyproject.toml.j2 +77 -0
  24. fauxcall-0.1.0/src/fauxcall/build/templates/fake/src/__init__.py.j2 +5 -0
  25. fauxcall-0.1.0/src/fauxcall/build/templates/fake/src/__main__.py.j2 +28 -0
  26. fauxcall-0.1.0/src/fauxcall/build/templates/fake/src/app.py.j2 +33 -0
  27. fauxcall-0.1.0/src/fauxcall/build/templates/fake/src/handlers.py.j2 +39 -0
  28. fauxcall-0.1.0/src/fauxcall/build/templates/fake/src/routes.py.j2 +27 -0
  29. fauxcall-0.1.0/src/fauxcall/build/templates/fake/src/settings.py.j2 +29 -0
  30. fauxcall-0.1.0/src/fauxcall/build/templates/fake/tests/conftest.py.j2 +23 -0
  31. fauxcall-0.1.0/src/fauxcall/build/templates/fake/tests/e2e/test_scenarios.py.j2 +22 -0
  32. fauxcall-0.1.0/src/fauxcall/build/templates/fake/tests/unit/test_app.py.j2 +62 -0
  33. fauxcall-0.1.0/src/fauxcall/build/templates/fake/tests/unit/test_recorded.py.j2 +39 -0
  34. fauxcall-0.1.0/src/fauxcall/build/templates/fake/tests/unit/test_routes.py.j2 +41 -0
  35. fauxcall-0.1.0/src/fauxcall/build/templates/workspace/README.md.j2 +29 -0
  36. fauxcall-0.1.0/src/fauxcall/build/templates/workspace/ci.yml.j2 +25 -0
  37. fauxcall-0.1.0/src/fauxcall/build/templates/workspace/compose.yaml.j2 +16 -0
  38. fauxcall-0.1.0/src/fauxcall/build/templates/workspace/dockerignore.j2 +14 -0
  39. fauxcall-0.1.0/src/fauxcall/build/templates/workspace/gitignore.j2 +13 -0
  40. fauxcall-0.1.0/src/fauxcall/build/templates/workspace/pyproject.toml.j2 +10 -0
  41. fauxcall-0.1.0/src/fauxcall/build/world.py +143 -0
  42. fauxcall-0.1.0/src/fauxcall/calendar.py +250 -0
  43. fauxcall-0.1.0/src/fauxcall/cli/__init__.py +1 -0
  44. fauxcall-0.1.0/src/fauxcall/cli/building.py +202 -0
  45. fauxcall-0.1.0/src/fauxcall/cli/common.py +172 -0
  46. fauxcall-0.1.0/src/fauxcall/cli/evidence.py +784 -0
  47. fauxcall-0.1.0/src/fauxcall/cli/main.py +81 -0
  48. fauxcall-0.1.0/src/fauxcall/cli/project.py +574 -0
  49. fauxcall-0.1.0/src/fauxcall/cli/running.py +243 -0
  50. fauxcall-0.1.0/src/fauxcall/clock.py +440 -0
  51. fauxcall-0.1.0/src/fauxcall/config.py +243 -0
  52. fauxcall-0.1.0/src/fauxcall/errors.py +31 -0
  53. fauxcall-0.1.0/src/fauxcall/jsonfmt.py +289 -0
  54. fauxcall-0.1.0/src/fauxcall/jsonpath.py +158 -0
  55. fauxcall-0.1.0/src/fauxcall/logs.py +161 -0
  56. fauxcall-0.1.0/src/fauxcall/mcpwire/__init__.py +4 -0
  57. fauxcall-0.1.0/src/fauxcall/mcpwire/client.py +430 -0
  58. fauxcall-0.1.0/src/fauxcall/mcpwire/protocol.py +237 -0
  59. fauxcall-0.1.0/src/fauxcall/model/__init__.py +125 -0
  60. fauxcall-0.1.0/src/fauxcall/model/api.py +262 -0
  61. fauxcall-0.1.0/src/fauxcall/model/auth.py +78 -0
  62. fauxcall-0.1.0/src/fauxcall/model/calendar.py +68 -0
  63. fauxcall-0.1.0/src/fauxcall/model/common.py +51 -0
  64. fauxcall-0.1.0/src/fauxcall/model/endpoints.py +300 -0
  65. fauxcall-0.1.0/src/fauxcall/model/errors.py +65 -0
  66. fauxcall-0.1.0/src/fauxcall/model/fields.py +198 -0
  67. fauxcall-0.1.0/src/fauxcall/model/jobs.py +99 -0
  68. fauxcall-0.1.0/src/fauxcall/model/mcp.py +104 -0
  69. fauxcall-0.1.0/src/fauxcall/model/plan.py +244 -0
  70. fauxcall-0.1.0/src/fauxcall/model/progress.py +131 -0
  71. fauxcall-0.1.0/src/fauxcall/model/realism.py +100 -0
  72. fauxcall-0.1.0/src/fauxcall/model/recording.py +123 -0
  73. fauxcall-0.1.0/src/fauxcall/model/semantic.py +69 -0
  74. fauxcall-0.1.0/src/fauxcall/model/world.py +104 -0
  75. fauxcall-0.1.0/src/fauxcall/paths.py +201 -0
  76. fauxcall-0.1.0/src/fauxcall/privacy/__init__.py +49 -0
  77. fauxcall-0.1.0/src/fauxcall/privacy/pii.py +831 -0
  78. fauxcall-0.1.0/src/fauxcall/privacy/pseudonym.py +691 -0
  79. fauxcall-0.1.0/src/fauxcall/privacy/redact.py +460 -0
  80. fauxcall-0.1.0/src/fauxcall/py.typed +0 -0
  81. fauxcall-0.1.0/src/fauxcall/recording/__init__.py +27 -0
  82. fauxcall-0.1.0/src/fauxcall/recording/mcp.py +530 -0
  83. fauxcall-0.1.0/src/fauxcall/recording/privacy_filter.py +266 -0
  84. fauxcall-0.1.0/src/fauxcall/recording/recorder.py +1126 -0
  85. fauxcall-0.1.0/src/fauxcall/recording/store.py +123 -0
  86. fauxcall-0.1.0/src/fauxcall/runtime/__init__.py +27 -0
  87. fauxcall-0.1.0/src/fauxcall/runtime/admin.py +214 -0
  88. fauxcall-0.1.0/src/fauxcall/runtime/app.py +728 -0
  89. fauxcall-0.1.0/src/fauxcall/runtime/auth.py +303 -0
  90. fauxcall-0.1.0/src/fauxcall/runtime/context.py +402 -0
  91. fauxcall-0.1.0/src/fauxcall/runtime/dynamic.py +67 -0
  92. fauxcall-0.1.0/src/fauxcall/runtime/faults.py +67 -0
  93. fauxcall-0.1.0/src/fauxcall/runtime/generators.py +76 -0
  94. fauxcall-0.1.0/src/fauxcall/runtime/handlers.py +630 -0
  95. fauxcall-0.1.0/src/fauxcall/runtime/inputs.py +59 -0
  96. fauxcall-0.1.0/src/fauxcall/runtime/jev.py +217 -0
  97. fauxcall-0.1.0/src/fauxcall/runtime/jobs.py +126 -0
  98. fauxcall-0.1.0/src/fauxcall/runtime/journal.py +160 -0
  99. fauxcall-0.1.0/src/fauxcall/runtime/listing.py +516 -0
  100. fauxcall-0.1.0/src/fauxcall/runtime/matching.py +132 -0
  101. fauxcall-0.1.0/src/fauxcall/runtime/mcp_server.py +490 -0
  102. fauxcall-0.1.0/src/fauxcall/runtime/oauth.py +239 -0
  103. fauxcall-0.1.0/src/fauxcall/runtime/params.py +219 -0
  104. fauxcall-0.1.0/src/fauxcall/runtime/policies.py +224 -0
  105. fauxcall-0.1.0/src/fauxcall/runtime/ratelimit.py +161 -0
  106. fauxcall-0.1.0/src/fauxcall/runtime/recordings.py +82 -0
  107. fauxcall-0.1.0/src/fauxcall/runtime/routing.py +110 -0
  108. fauxcall-0.1.0/src/fauxcall/runtime/series.py +96 -0
  109. fauxcall-0.1.0/src/fauxcall/runtime/streaming.py +284 -0
  110. fauxcall-0.1.0/src/fauxcall/runtime/templating.py +136 -0
  111. fauxcall-0.1.0/src/fauxcall/spec/__init__.py +40 -0
  112. fauxcall-0.1.0/src/fauxcall/spec/discover.py +954 -0
  113. fauxcall-0.1.0/src/fauxcall/spec/docs.py +286 -0
  114. fauxcall-0.1.0/src/fauxcall/spec/loader.py +309 -0
  115. fauxcall-0.1.0/src/fauxcall/spec/openapi.py +1036 -0
  116. fauxcall-0.1.0/src/fauxcall/storage.py +135 -0
  117. fauxcall-0.1.0/src/fauxcall/testing/__init__.py +17 -0
  118. fauxcall-0.1.0/src/fauxcall/testing/asgi.py +123 -0
  119. fauxcall-0.1.0/src/fauxcall/testing/client.py +553 -0
  120. fauxcall-0.1.0/src/fauxcall/testing/compare.py +515 -0
  121. fauxcall-0.1.0/src/fauxcall/testing/plugin.py +447 -0
  122. fauxcall-0.1.0/src/fauxcall/testing/report.py +195 -0
  123. fauxcall-0.1.0/src/fauxcall/testing/support.py +325 -0
  124. fauxcall-0.1.0/src/fauxcall/timefmt.py +395 -0
  125. fauxcall-0.1.0/src/fauxcall/types.py +32 -0
  126. fauxcall-0.1.0/src/fauxcall/world/__init__.py +55 -0
  127. fauxcall-0.1.0/src/fauxcall/world/expand.py +192 -0
  128. fauxcall-0.1.0/src/fauxcall/world/invariants.py +261 -0
  129. fauxcall-0.1.0/src/fauxcall/world/io.py +124 -0
  130. fauxcall-0.1.0/src/fauxcall/world/keys.py +210 -0
  131. fauxcall-0.1.0/src/fauxcall/world/store.py +573 -0
fauxcall-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,256 @@
1
+ Metadata-Version: 2.4
2
+ Name: fauxcall
3
+ Version: 0.1.0
4
+ Summary: Record real APIs and MCP servers, then serve high-fidelity, consistent, time-aware fakes for repeatable agent testing.
5
+ Keywords: mock,fake,api,mcp,openapi,agents,testing,evaluation,claude-code
6
+ Author: Brad Nemetski
7
+ Author-email: Brad Nemetski <brad.nemetski@gmail.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: FastAPI
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: MacOS
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Testing :: Mocking
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: beautifulsoup4>=4.12
22
+ Requires-Dist: faker>=30.0
23
+ Requires-Dist: fastapi>=0.120
24
+ Requires-Dist: httpx2[ws]>=2.10
25
+ Requires-Dist: jinja2>=3.1.6
26
+ Requires-Dist: jsonschema>=4.23
27
+ Requires-Dist: pydantic>=2.12
28
+ Requires-Dist: pydantic-settings>=2.10
29
+ Requires-Dist: python-multipart>=0.0.20
30
+ Requires-Dist: pyyaml>=6.0.2
31
+ Requires-Dist: structlog>=25.1
32
+ Requires-Dist: typer>=0.16
33
+ Requires-Dist: typesafe-sdk>=0.7
34
+ Requires-Dist: tzdata>=2025.2
35
+ Requires-Dist: uvicorn[standard]>=0.35
36
+ Requires-Dist: pytest>=9.0 ; extra == 'testing'
37
+ Requires-Dist: pytest-asyncio>=1.2 ; extra == 'testing'
38
+ Requires-Python: >=3.12
39
+ Project-URL: Homepage, https://github.com/bradnemetski/fauxcall
40
+ Project-URL: Repository, https://github.com/bradnemetski/fauxcall
41
+ Project-URL: Issues, https://github.com/bradnemetski/fauxcall/issues
42
+ Project-URL: Changelog, https://github.com/bradnemetski/fauxcall/blob/main/CHANGELOG.md
43
+ Provides-Extra: testing
44
+ Description-Content-Type: text/markdown
45
+
46
+ # FauxCall
47
+
48
+ **Build a faithful fake of any API or MCP server, so you can test your agents without touching the
49
+ real thing.**
50
+
51
+ Give FauxCall an API's Swagger/OpenAPI page, its documentation, or the address of an MCP server. It
52
+ calls the real service, one endpoint at a time, and builds a local copy that answers the same way:
53
+ the same URLs, parameters, responses and errors. Then it runs the same tests against both and
54
+ keeps fixing the fake until they agree at least 98% of the time.
55
+
56
+ ```text
57
+ /fauxcall https://petstore3.swagger.io
58
+ ```
59
+
60
+ ## Why
61
+
62
+ Testing agents against real services is painful. The data changes between runs, calls cost money
63
+ and hit rate limits, and you really don't want a test run to place an actual order. Hand-written
64
+ mocks avoid that but bring their own problems: they slowly drift away from the real API, their data
65
+ doesn't hang together, and they ignore time completely.
66
+
67
+ A FauxCall fake is built from real responses, so it behaves like the original:
68
+
69
+ - **It looks the same.** Every URL, parameter, status code, header and error message matches, down
70
+ to how numbers are written (`1.50` stays `1.50`). MCP fakes have the same tools, resources and
71
+ prompts.
72
+ - **Its data adds up.** If a stock references an exchange, that exchange exists. If you upload a
73
+ file, it shows up in the status endpoint and goes through the same steps, at the same pace, as on
74
+ the real API.
75
+ - **It knows what time it is.** Asking for the current time gets you the actual time. A stock's
76
+ timestamp moves during trading hours and stops at the last trade overnight, while the price stays
77
+ where it closed. Dates come back in exactly the real format.
78
+ - **It behaves like the real thing under load.** Real response times, the real rate limits (with
79
+ proper `429` errors), pagination, background jobs, file uploads and downloads, live streams
80
+ (Server-Sent Events and WebSockets), and MCP over HTTP, including sign-in with OAuth.
81
+ - **It's made for testing.** You can freeze or move the clock, see every call your agent made,
82
+ inject failures, give parallel test runs their own separate state, and reset everything between
83
+ runs.
84
+
85
+ ## Quick start (Claude Code)
86
+
87
+ You need [Claude Code](https://claude.com/claude-code) and [uv](https://docs.astral.sh/uv/). uv
88
+ takes care of installing Python.
89
+
90
+ 1. **Install the plugin:**
91
+
92
+ ```bash
93
+ claude plugin marketplace add bradnemetski/fauxcall
94
+ claude plugin install fauxcall@fauxcall
95
+ ```
96
+
97
+ (Inside Claude Code, `/plugin marketplace add bradnemetski/fauxcall` and
98
+ `/plugin install fauxcall@fauxcall` do the same.)
99
+
100
+ 2. **Build a fake.** In Claude Code, point the skill at a spec, a docs page or an MCP server:
101
+
102
+ ```text
103
+ /fauxcall https://petstore3.swagger.io
104
+ /fauxcall https://api.frankfurter.dev/v1/openapi.json
105
+ /fauxcall https://mcp.deepwiki.com/mcp
106
+ ```
107
+
108
+ Before it starts, Claude asks you everything it needs in one go: any credentials, whether you
109
+ have a Jev key, and permission for calls that would change data on the real service, along with
110
+ how many such calls it may make. After that it works on its own. If it gets interrupted, run the
111
+ same command again and it picks up where it stopped.
112
+
113
+ 3. **Run the fake and point your agent at it:**
114
+
115
+ ```bash
116
+ uvx fauxcall up # starts every fake in ./fauxcall and prints their addresses
117
+ ```
118
+
119
+ Use the printed address instead of the real API's. For an MCP server, FauxCall also prints the
120
+ snippet to paste into your agent's configuration.
121
+
122
+ ## Using it with other agents
123
+
124
+ FauxCall isn't tied to Claude Code. Its skills are plain [Agent Skills](https://agentskills.io)
125
+ (`SKILL.md` files), and all the real work happens in the `fauxcall` command, so any agent that
126
+ reads skills and can run shell commands can use it: Codex, Gemini CLI, Cursor, GitHub Copilot and
127
+ others.
128
+
129
+ 1. **Install the `fauxcall` command:**
130
+
131
+ ```bash
132
+ uv tool install fauxcall # once it's on PyPI
133
+ uv tool install git+https://github.com/bradnemetski/fauxcall # or straight from GitHub
134
+ ```
135
+
136
+ 2. **Copy the skills to where your agent looks for them.** Most agents read the shared
137
+ `~/.agents/skills/` folder (or `.agents/skills/` inside a project); some also have their own,
138
+ such as `~/.cursor/skills/` or `.github/skills/`. Check your agent's documentation.
139
+
140
+ ```bash
141
+ git clone https://github.com/bradnemetski/fauxcall
142
+ mkdir -p ~/.agents/skills
143
+ cp -R fauxcall/plugins/fauxcall/skills/* ~/.agents/skills/
144
+ ```
145
+
146
+ That installs five skills: `fauxcall`, `refresh`, `verify`, `extend` and `serve`. If those last
147
+ four names clash with skills you already have, copy just `fauxcall`. It covers a whole build on
148
+ its own.
149
+
150
+ 3. **Ask your agent to use it**, for example "use the fauxcall skill to fake
151
+ https://petstore3.swagger.io".
152
+
153
+ A few things are smoother in Claude Code: it asks the up-front questions as a form, and runs the
154
+ final independent review as a separate subagent. Other agents do the same steps in the
155
+ conversation.
156
+
157
+ ## What you get
158
+
159
+ Each fake is a small, ordinary FastAPI project in `./fauxcall/<name>/`:
160
+
161
+ ```text
162
+ your-project/
163
+ ├── fauxcall/
164
+ │ ├── petstore/
165
+ │ │ ├── data/model.json # everything the fake knows, in one readable file
166
+ │ │ ├── data/recordings/ # the real requests and responses it was built from
167
+ │ │ ├── data/world/ # the data it serves
168
+ │ │ ├── src/fauxcall_petstore/ # its routes, plus any custom code
169
+ │ │ ├── tests/ # its tests
170
+ │ │ └── Dockerfile
171
+ │ ├── compose.yaml # runs all your fakes in containers
172
+ │ └── pyproject.toml # one uv workspace for all of them
173
+ └── .github/workflows/fauxcall.yml # CI that keeps the fakes tested
174
+ ```
175
+
176
+ Run a fake's tests offline, or against the real service to see whether the real API has changed:
177
+
178
+ ```bash
179
+ cd fauxcall/petstore
180
+ uv run pytest # offline tests
181
+ uv run pytest tests/e2e --target=parity # same tests against both; fails below 98%
182
+ ```
183
+
184
+ The [`examples/`](examples/) folder has fakes FauxCall built by itself, from a single command each,
185
+ while we were testing it: Frankfurter, timeapi.io, Swagger Petstore, FakeRESTApi and this
186
+ repository's own reference API.
187
+
188
+ ## Using fakes in tests
189
+
190
+ Every fake has a small control API under `/__fauxcall`:
191
+
192
+ | Call | What it does |
193
+ |---|---|
194
+ | `POST /__fauxcall/reset` | Put the data back the way it was recorded (for everyone, or for one test run) |
195
+ | `POST /__fauxcall/clock` | Freeze time, jump to a date, speed it up, or go back to real time. Moving the clock forward also lifts rate limits |
196
+ | `GET /__fauxcall/journal` | List every call your agent made, with requests and responses |
197
+ | `PUT /__fauxcall/faults` | Make calls fail: errors, timeouts, delays, dropped connections or `429`s |
198
+ | `PUT /__fauxcall/auth/users` | Choose which users are allowed, refused or expired |
199
+
200
+ To run tests in parallel, give each run its own name in an `X-Fauxcall-Session` header. It then gets
201
+ its own data and its own clock. Set `FAUXCALL_FAST=1` to skip the realistic delays and rate limits.
202
+
203
+ ## Skills
204
+
205
+ | Skill | What it's for |
206
+ |---|---|
207
+ | `/fauxcall <url>` | Build a fake, or carry on with an interrupted build |
208
+ | `/fauxcall:refresh <name>` | Re-record a fake after the real API has changed |
209
+ | `/fauxcall:verify <name>` | Check a fake against the real service and fix what's off |
210
+ | `/fauxcall:extend <name>` | Add endpoints, test scenarios or behavior to a fake |
211
+ | `/fauxcall:serve` | Start fakes and hook them up to your agent |
212
+
213
+ ## Privacy and safety
214
+
215
+ - **Your credentials stay private.** They live only in each fake's `.env` file, which you fill in
216
+ and which git ignores. They're scrubbed from recordings, logs and the call journal, and never
217
+ copied into Docker images.
218
+ - **Personal data is replaced with realistic stand-ins** as it's recorded, consistently, so a
219
+ customer's name is replaced the same way in every response.
220
+ - **Nothing that changes data happens without your OK.** Before recording, you see the calls that
221
+ would create, change or delete things, and approve them once. You also set how many such calls
222
+ each endpoint may make (100 unless you choose otherwise; set `FAUXCALL_APPROVAL_BUDGET` to change
223
+ the default).
224
+ - **It's polite to the real service.** Recording is slowed down to stay within rate limits, and
225
+ capped.
226
+
227
+ ## Jev (optional)
228
+
229
+ If you have a [TypeSafe](https://typesafe.ai) Jev key, a fake can use it to make judgment calls its
230
+ recordings don't cover, for example picking which recorded answer best fits a question it hasn't
231
+ seen before. Its answers are saved with the fake, so they replay later without the key. Without a
232
+ key, the fake uses simple, predictable rules instead.
233
+
234
+ ## The `fauxcall` command
235
+
236
+ The skills drive the `fauxcall` command-line tool, and you can use it directly too:
237
+
238
+ ```bash
239
+ uvx fauxcall status # how far each fake's build has got
240
+ uvx fauxcall serve petstore # run one fake in the foreground
241
+ uvx fauxcall verify petstore --target parity
242
+ uvx fauxcall --help # everything else
243
+ ```
244
+
245
+ ## Learn more
246
+
247
+ - [Examples](examples/): fakes FauxCall built by itself, ready to run
248
+ - [How it was tested](docs/validation.md): the method, the services we tried and the results
249
+ - [How it works](docs/architecture.md): the pipeline, the model and the runtime
250
+ - [Configuration](docs/configuration.md): every setting
251
+ - [Design decisions](docs/decisions.md): what we decided and why
252
+ - [Contributing](CONTRIBUTING.md) and [security](SECURITY.md)
253
+
254
+ ## License
255
+
256
+ [Apache-2.0](LICENSE)
@@ -0,0 +1,211 @@
1
+ # FauxCall
2
+
3
+ **Build a faithful fake of any API or MCP server, so you can test your agents without touching the
4
+ real thing.**
5
+
6
+ Give FauxCall an API's Swagger/OpenAPI page, its documentation, or the address of an MCP server. It
7
+ calls the real service, one endpoint at a time, and builds a local copy that answers the same way:
8
+ the same URLs, parameters, responses and errors. Then it runs the same tests against both and
9
+ keeps fixing the fake until they agree at least 98% of the time.
10
+
11
+ ```text
12
+ /fauxcall https://petstore3.swagger.io
13
+ ```
14
+
15
+ ## Why
16
+
17
+ Testing agents against real services is painful. The data changes between runs, calls cost money
18
+ and hit rate limits, and you really don't want a test run to place an actual order. Hand-written
19
+ mocks avoid that but bring their own problems: they slowly drift away from the real API, their data
20
+ doesn't hang together, and they ignore time completely.
21
+
22
+ A FauxCall fake is built from real responses, so it behaves like the original:
23
+
24
+ - **It looks the same.** Every URL, parameter, status code, header and error message matches, down
25
+ to how numbers are written (`1.50` stays `1.50`). MCP fakes have the same tools, resources and
26
+ prompts.
27
+ - **Its data adds up.** If a stock references an exchange, that exchange exists. If you upload a
28
+ file, it shows up in the status endpoint and goes through the same steps, at the same pace, as on
29
+ the real API.
30
+ - **It knows what time it is.** Asking for the current time gets you the actual time. A stock's
31
+ timestamp moves during trading hours and stops at the last trade overnight, while the price stays
32
+ where it closed. Dates come back in exactly the real format.
33
+ - **It behaves like the real thing under load.** Real response times, the real rate limits (with
34
+ proper `429` errors), pagination, background jobs, file uploads and downloads, live streams
35
+ (Server-Sent Events and WebSockets), and MCP over HTTP, including sign-in with OAuth.
36
+ - **It's made for testing.** You can freeze or move the clock, see every call your agent made,
37
+ inject failures, give parallel test runs their own separate state, and reset everything between
38
+ runs.
39
+
40
+ ## Quick start (Claude Code)
41
+
42
+ You need [Claude Code](https://claude.com/claude-code) and [uv](https://docs.astral.sh/uv/). uv
43
+ takes care of installing Python.
44
+
45
+ 1. **Install the plugin:**
46
+
47
+ ```bash
48
+ claude plugin marketplace add bradnemetski/fauxcall
49
+ claude plugin install fauxcall@fauxcall
50
+ ```
51
+
52
+ (Inside Claude Code, `/plugin marketplace add bradnemetski/fauxcall` and
53
+ `/plugin install fauxcall@fauxcall` do the same.)
54
+
55
+ 2. **Build a fake.** In Claude Code, point the skill at a spec, a docs page or an MCP server:
56
+
57
+ ```text
58
+ /fauxcall https://petstore3.swagger.io
59
+ /fauxcall https://api.frankfurter.dev/v1/openapi.json
60
+ /fauxcall https://mcp.deepwiki.com/mcp
61
+ ```
62
+
63
+ Before it starts, Claude asks you everything it needs in one go: any credentials, whether you
64
+ have a Jev key, and permission for calls that would change data on the real service, along with
65
+ how many such calls it may make. After that it works on its own. If it gets interrupted, run the
66
+ same command again and it picks up where it stopped.
67
+
68
+ 3. **Run the fake and point your agent at it:**
69
+
70
+ ```bash
71
+ uvx fauxcall up # starts every fake in ./fauxcall and prints their addresses
72
+ ```
73
+
74
+ Use the printed address instead of the real API's. For an MCP server, FauxCall also prints the
75
+ snippet to paste into your agent's configuration.
76
+
77
+ ## Using it with other agents
78
+
79
+ FauxCall isn't tied to Claude Code. Its skills are plain [Agent Skills](https://agentskills.io)
80
+ (`SKILL.md` files), and all the real work happens in the `fauxcall` command, so any agent that
81
+ reads skills and can run shell commands can use it: Codex, Gemini CLI, Cursor, GitHub Copilot and
82
+ others.
83
+
84
+ 1. **Install the `fauxcall` command:**
85
+
86
+ ```bash
87
+ uv tool install fauxcall # once it's on PyPI
88
+ uv tool install git+https://github.com/bradnemetski/fauxcall # or straight from GitHub
89
+ ```
90
+
91
+ 2. **Copy the skills to where your agent looks for them.** Most agents read the shared
92
+ `~/.agents/skills/` folder (or `.agents/skills/` inside a project); some also have their own,
93
+ such as `~/.cursor/skills/` or `.github/skills/`. Check your agent's documentation.
94
+
95
+ ```bash
96
+ git clone https://github.com/bradnemetski/fauxcall
97
+ mkdir -p ~/.agents/skills
98
+ cp -R fauxcall/plugins/fauxcall/skills/* ~/.agents/skills/
99
+ ```
100
+
101
+ That installs five skills: `fauxcall`, `refresh`, `verify`, `extend` and `serve`. If those last
102
+ four names clash with skills you already have, copy just `fauxcall`. It covers a whole build on
103
+ its own.
104
+
105
+ 3. **Ask your agent to use it**, for example "use the fauxcall skill to fake
106
+ https://petstore3.swagger.io".
107
+
108
+ A few things are smoother in Claude Code: it asks the up-front questions as a form, and runs the
109
+ final independent review as a separate subagent. Other agents do the same steps in the
110
+ conversation.
111
+
112
+ ## What you get
113
+
114
+ Each fake is a small, ordinary FastAPI project in `./fauxcall/<name>/`:
115
+
116
+ ```text
117
+ your-project/
118
+ ├── fauxcall/
119
+ │ ├── petstore/
120
+ │ │ ├── data/model.json # everything the fake knows, in one readable file
121
+ │ │ ├── data/recordings/ # the real requests and responses it was built from
122
+ │ │ ├── data/world/ # the data it serves
123
+ │ │ ├── src/fauxcall_petstore/ # its routes, plus any custom code
124
+ │ │ ├── tests/ # its tests
125
+ │ │ └── Dockerfile
126
+ │ ├── compose.yaml # runs all your fakes in containers
127
+ │ └── pyproject.toml # one uv workspace for all of them
128
+ └── .github/workflows/fauxcall.yml # CI that keeps the fakes tested
129
+ ```
130
+
131
+ Run a fake's tests offline, or against the real service to see whether the real API has changed:
132
+
133
+ ```bash
134
+ cd fauxcall/petstore
135
+ uv run pytest # offline tests
136
+ uv run pytest tests/e2e --target=parity # same tests against both; fails below 98%
137
+ ```
138
+
139
+ The [`examples/`](examples/) folder has fakes FauxCall built by itself, from a single command each,
140
+ while we were testing it: Frankfurter, timeapi.io, Swagger Petstore, FakeRESTApi and this
141
+ repository's own reference API.
142
+
143
+ ## Using fakes in tests
144
+
145
+ Every fake has a small control API under `/__fauxcall`:
146
+
147
+ | Call | What it does |
148
+ |---|---|
149
+ | `POST /__fauxcall/reset` | Put the data back the way it was recorded (for everyone, or for one test run) |
150
+ | `POST /__fauxcall/clock` | Freeze time, jump to a date, speed it up, or go back to real time. Moving the clock forward also lifts rate limits |
151
+ | `GET /__fauxcall/journal` | List every call your agent made, with requests and responses |
152
+ | `PUT /__fauxcall/faults` | Make calls fail: errors, timeouts, delays, dropped connections or `429`s |
153
+ | `PUT /__fauxcall/auth/users` | Choose which users are allowed, refused or expired |
154
+
155
+ To run tests in parallel, give each run its own name in an `X-Fauxcall-Session` header. It then gets
156
+ its own data and its own clock. Set `FAUXCALL_FAST=1` to skip the realistic delays and rate limits.
157
+
158
+ ## Skills
159
+
160
+ | Skill | What it's for |
161
+ |---|---|
162
+ | `/fauxcall <url>` | Build a fake, or carry on with an interrupted build |
163
+ | `/fauxcall:refresh <name>` | Re-record a fake after the real API has changed |
164
+ | `/fauxcall:verify <name>` | Check a fake against the real service and fix what's off |
165
+ | `/fauxcall:extend <name>` | Add endpoints, test scenarios or behavior to a fake |
166
+ | `/fauxcall:serve` | Start fakes and hook them up to your agent |
167
+
168
+ ## Privacy and safety
169
+
170
+ - **Your credentials stay private.** They live only in each fake's `.env` file, which you fill in
171
+ and which git ignores. They're scrubbed from recordings, logs and the call journal, and never
172
+ copied into Docker images.
173
+ - **Personal data is replaced with realistic stand-ins** as it's recorded, consistently, so a
174
+ customer's name is replaced the same way in every response.
175
+ - **Nothing that changes data happens without your OK.** Before recording, you see the calls that
176
+ would create, change or delete things, and approve them once. You also set how many such calls
177
+ each endpoint may make (100 unless you choose otherwise; set `FAUXCALL_APPROVAL_BUDGET` to change
178
+ the default).
179
+ - **It's polite to the real service.** Recording is slowed down to stay within rate limits, and
180
+ capped.
181
+
182
+ ## Jev (optional)
183
+
184
+ If you have a [TypeSafe](https://typesafe.ai) Jev key, a fake can use it to make judgment calls its
185
+ recordings don't cover, for example picking which recorded answer best fits a question it hasn't
186
+ seen before. Its answers are saved with the fake, so they replay later without the key. Without a
187
+ key, the fake uses simple, predictable rules instead.
188
+
189
+ ## The `fauxcall` command
190
+
191
+ The skills drive the `fauxcall` command-line tool, and you can use it directly too:
192
+
193
+ ```bash
194
+ uvx fauxcall status # how far each fake's build has got
195
+ uvx fauxcall serve petstore # run one fake in the foreground
196
+ uvx fauxcall verify petstore --target parity
197
+ uvx fauxcall --help # everything else
198
+ ```
199
+
200
+ ## Learn more
201
+
202
+ - [Examples](examples/): fakes FauxCall built by itself, ready to run
203
+ - [How it was tested](docs/validation.md): the method, the services we tried and the results
204
+ - [How it works](docs/architecture.md): the pipeline, the model and the runtime
205
+ - [Configuration](docs/configuration.md): every setting
206
+ - [Design decisions](docs/decisions.md): what we decided and why
207
+ - [Contributing](CONTRIBUTING.md) and [security](SECURITY.md)
208
+
209
+ ## License
210
+
211
+ [Apache-2.0](LICENSE)