fba-bench-core 1.0.0__py3-none-any.whl

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 (52) hide show
  1. fba_bench_core/__init__.py +11 -0
  2. fba_bench_core/agents/__init__.py +15 -0
  3. fba_bench_core/agents/base.py +83 -0
  4. fba_bench_core/agents/registry.py +16 -0
  5. fba_bench_core/benchmarking/__init__.py +6 -0
  6. fba_bench_core/benchmarking/core/__init__.py +1 -0
  7. fba_bench_core/benchmarking/engine/__init__.py +12 -0
  8. fba_bench_core/benchmarking/engine/core.py +135 -0
  9. fba_bench_core/benchmarking/engine/models.py +62 -0
  10. fba_bench_core/benchmarking/metrics/__init__.py +30 -0
  11. fba_bench_core/benchmarking/metrics/accuracy_score.py +27 -0
  12. fba_bench_core/benchmarking/metrics/aggregate.py +39 -0
  13. fba_bench_core/benchmarking/metrics/completeness.py +38 -0
  14. fba_bench_core/benchmarking/metrics/cost_efficiency.py +32 -0
  15. fba_bench_core/benchmarking/metrics/custom_scriptable.py +17 -0
  16. fba_bench_core/benchmarking/metrics/keyword_coverage.py +41 -0
  17. fba_bench_core/benchmarking/metrics/policy_compliance.py +18 -0
  18. fba_bench_core/benchmarking/metrics/registry.py +57 -0
  19. fba_bench_core/benchmarking/metrics/robustness.py +27 -0
  20. fba_bench_core/benchmarking/metrics/technical_performance.py +16 -0
  21. fba_bench_core/benchmarking/registry.py +48 -0
  22. fba_bench_core/benchmarking/scenarios/__init__.py +1 -0
  23. fba_bench_core/benchmarking/scenarios/base.py +36 -0
  24. fba_bench_core/benchmarking/scenarios/complex_marketplace.py +181 -0
  25. fba_bench_core/benchmarking/scenarios/multiturn_tool_use.py +176 -0
  26. fba_bench_core/benchmarking/scenarios/registry.py +18 -0
  27. fba_bench_core/benchmarking/scenarios/research_summarization.py +141 -0
  28. fba_bench_core/benchmarking/validators/__init__.py +24 -0
  29. fba_bench_core/benchmarking/validators/determinism_check.py +95 -0
  30. fba_bench_core/benchmarking/validators/fairness_balance.py +75 -0
  31. fba_bench_core/benchmarking/validators/outlier_detection.py +53 -0
  32. fba_bench_core/benchmarking/validators/registry.py +57 -0
  33. fba_bench_core/benchmarking/validators/reproducibility_metadata.py +74 -0
  34. fba_bench_core/benchmarking/validators/schema_adherence.py +59 -0
  35. fba_bench_core/benchmarking/validators/structural_consistency.py +74 -0
  36. fba_bench_core/config.py +154 -0
  37. fba_bench_core/domain/__init__.py +75 -0
  38. fba_bench_core/domain/events/__init__.py +230 -0
  39. fba_bench_core/domain/events/analytics.py +69 -0
  40. fba_bench_core/domain/events/base.py +59 -0
  41. fba_bench_core/domain/events/inventory.py +119 -0
  42. fba_bench_core/domain/events/marketing.py +102 -0
  43. fba_bench_core/domain/events/pricing.py +179 -0
  44. fba_bench_core/domain/models.py +296 -0
  45. fba_bench_core/exceptions/__init__.py +9 -0
  46. fba_bench_core/exceptions/base.py +46 -0
  47. fba_bench_core/services/__init__.py +12 -0
  48. fba_bench_core/services/base.py +52 -0
  49. fba_bench_core-1.0.0.dist-info/METADATA +152 -0
  50. fba_bench_core-1.0.0.dist-info/RECORD +52 -0
  51. fba_bench_core-1.0.0.dist-info/WHEEL +4 -0
  52. fba_bench_core-1.0.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: fba-bench-core
3
+ Version: 1.0.0
4
+ Summary: Core interfaces, data models, and events for the FBA-Bench simulation platform.
5
+ License: Apache-2.0
6
+ License-File: LICENSE
7
+ Keywords: benchmarking,simulation,fba,pydantic,typing
8
+ Author: FBA Team
9
+ Author-email: devnull@example.com
10
+ Requires-Python: >=3.11,<4.0
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Classifier: Typing :: Typed
20
+ Requires-Dist: pydantic (>=2.0,<3.0)
21
+ Project-URL: Documentation, https://your-org.github.io/fba-bench-core
22
+ Project-URL: Homepage, https://github.com/your-org/fba-bench-core
23
+ Project-URL: Issues, https://github.com/your-org/fba-bench-core/issues
24
+ Project-URL: Repository, https://github.com/your-org/fba-bench-core
25
+ Description-Content-Type: text/markdown
26
+
27
+ # FBA-Bench Core — Contract-first Core Library
28
+
29
+ Overview
30
+
31
+ FBA-Bench Core is a compact, contract-first library for building and
32
+ simulating Fulfillment-By-Amazon-style (FBA) business automation scenarios.
33
+ The rebuilt core emphasizes explicit, versioned contracts (Pydantic v2 models)
34
+ for domain models, events, commands, and typed configuration objects so
35
+ downstream projects can reliably validate and integrate simulation logic.
36
+
37
+ Key principles
38
+
39
+ - Contract-first: canonical Pydantic v2 models are the single source of truth.
40
+ - Typed, immutable configs: configuration objects are frozen models; use
41
+ model_copy(update={...}) to derive modified instances.
42
+ - Explicit events/commands: typed discriminated unions with strict validation
43
+ (extra="forbid") to make integration predictable.
44
+
45
+ Core modules
46
+
47
+ - Domain models: [`src/fba_bench_core/domain/models.py`](src/fba_bench_core/domain/models.py:1)
48
+ - Product, InventorySnapshot, CompetitorListing, Competitor, DemandProfile
49
+ - Events & Commands: [`src/fba_bench_core/domain/events.py`](src/fba_bench_core/domain/events.py:1)
50
+ - Typed BaseEvent/BaseCommand hierarchy and concrete events like SaleOccurred,
51
+ StockReplenished, PromotionLaunched; commands like AdjustPriceCommand,
52
+ PlaceReplenishmentOrderCommand.
53
+ - Agent/service base classes: [`src/fba_bench_core/agents/base.py`](src/fba_bench_core/agents/base.py:1)
54
+ and [`src/fba_bench_core/services/base.py`](src/fba_bench_core/services/base.py:1)
55
+ - Typed configs: [`src/fba_bench_core/config.py`](src/fba_bench_core/config.py:1)
56
+ - BaseAgentConfig, BaseServiceConfig (immutable, extra="forbid")
57
+
58
+ Quick start (Poetry)
59
+
60
+ Clone and install with Poetry:
61
+
62
+ ```bash
63
+ git clone <repo-url>
64
+ cd FBA-Bench-core
65
+ poetry install
66
+ ```
67
+
68
+ Run the test suite:
69
+
70
+ ```bash
71
+ poetry run pytest -q
72
+ ```
73
+
74
+ Using Core from another project
75
+
76
+ 1. Add FBA-Bench Core as a dependency (editable/local for development):
77
+
78
+ ```bash
79
+ pip install -e /path/to/FBA-Bench-core
80
+ ```
81
+
82
+ 2. Import domain models and instantiate typed configs:
83
+
84
+ ```python
85
+ from fba_bench_core.domain.models import Product
86
+ from fba_bench_core.config import BaseAgentConfig
87
+
88
+ p = Product(product_id="sku-1", cost="1.00", price="2.00", stock=10)
89
+ cfg = BaseAgentConfig(agent_id="pricing-agent", poll_interval_seconds=30)
90
+ ```
91
+
92
+ Migration guidance
93
+
94
+ If you are upgrading from a legacy core:
95
+ - See the migration guide: [`docs/migration-guide.md`](docs/migration-guide.md:1)
96
+ - Key actions: import canonical models, convert numeric values to Decimal,
97
+ and replace mutable dict-based configs with typed Base*Config models.
98
+
99
+ Tests, linting and quality commands
100
+
101
+ The CI pipeline runs formatting, linting, type-checking and tests. Locally you
102
+ can run the same commands via Poetry:
103
+
104
+ ```bash
105
+ poetry run black src tests
106
+ poetry run isort src tests
107
+ poetry run flake8 src tests
108
+ poetry run mypy
109
+ poetry run pytest
110
+ ```
111
+
112
+ Packaging & versioning workflow
113
+
114
+ - CHANGELOG.md is generated from small towncrier fragments placed under
115
+ [`newsfragments/`](newsfragments/:1) and built with `towncrier`.
116
+ - To add a changelog fragment: create a brief file `newsfragments/NN.description`
117
+ then run `poetry run towncrier build --yes`.
118
+ - Version tooling: this repository includes [.bumpver.toml](.bumpver.toml:1)
119
+ and uses dynamic versioning in the packaging pipeline. Follow project policy
120
+ for release tagging and bumping; maintainers should prefer automated tools
121
+ (bumpver) that integrate with CI.
122
+
123
+ Architecture and contracts
124
+
125
+ See the in-repo architecture notes for the rebuilt core:
126
+ - Core contracts: [`docs/architecture/core-contracts.md`](docs/architecture/core-contracts.md:1)
127
+ - Architecture overview: [`docs/architecture.md`](docs/architecture.md:1)
128
+
129
+ Documentation & rescue log
130
+
131
+ The rescue log contains per-phase notes about the rebuild:
132
+ - [`docs/rescue_log.md`](docs/rescue_log.md:1)
133
+ - Phase G′ (Phase G-prime) documents updated documentation artifacts and
134
+ provides migration guidance for consumers; see [`docs/migration-guide.md`](docs/migration-guide.md:1).
135
+
136
+ Contributing
137
+
138
+ Please follow Conventional Commits for PRs, include tests for contract changes,
139
+ and place towncrier fragments under `newsfragments/` for changelog entries.
140
+ See [`docs/README.md`](docs/README.md:1) for broader documentation contribution
141
+ guidelines.
142
+
143
+ Tooling
144
+
145
+ - Pre-commit hooks are configured in [`.pre-commit-config.yaml`](.pre-commit-config.yaml:1).
146
+ - Towncrier configuration is in [`.towncrier.toml`](.towncrier.toml:1).
147
+
148
+ License & contact
149
+
150
+ - License: MIT — see [`LICENSE`](LICENSE:1)
151
+ - Contact: project maintainers via repository issues or `press@fba-bench.ai`.
152
+
@@ -0,0 +1,52 @@
1
+ fba_bench_core/__init__.py,sha256=kyC30sfGB24jCzZIDNZTHQKYzbcU2Z4J2TUS3-l6Ds8,340
2
+ fba_bench_core/agents/__init__.py,sha256=YqxXvD5vygNb6riGUDkfLLAyHWvpCd6cq5f9hDRi6yI,496
3
+ fba_bench_core/agents/base.py,sha256=NQbKqobRwJYV_KsKL7I3_lG2QKdxlKHPFJUAYjIfWNY,3131
4
+ fba_bench_core/agents/registry.py,sha256=J9lU6-ZuB75C9Jd49GREKr6zElKr0mihTESSN3xMrvE,487
5
+ fba_bench_core/benchmarking/__init__.py,sha256=Ss7kXFD5zW6otb_xFUEUTwljYtEcx00VnsIRcXZOcik,170
6
+ fba_bench_core/benchmarking/core/__init__.py,sha256=f9brJoHmLuztcmGsA0CkSfETBxcQNUCQWjjbRCYm9w4,27
7
+ fba_bench_core/benchmarking/engine/__init__.py,sha256=tzTLCBjPrsJOww6-ORuzpWA4LrBW1bPVXlcsR6BaTH4,262
8
+ fba_bench_core/benchmarking/engine/core.py,sha256=oQwYOR8_QI8I13_5rYf1jRADuk5kNC-3Gg-m6eZcyUQ,5548
9
+ fba_bench_core/benchmarking/engine/models.py,sha256=7d6doUC2ggJoiPdb7HGYFryHyjU-KyBg09TH-Uw8Y3g,1392
10
+ fba_bench_core/benchmarking/metrics/__init__.py,sha256=G7lseePIxiCtrHEbgnI73mv1jLt0mHZzjyLNxlGJf-w,627
11
+ fba_bench_core/benchmarking/metrics/accuracy_score.py,sha256=h6Jmmv178jXtmn7YjNGo8nLEu1ELN3sVNS0DD-_ChKI,769
12
+ fba_bench_core/benchmarking/metrics/aggregate.py,sha256=J96Klsqiak-WFx4gffBErPibT0ZD3WmSEBvyLJCz4U0,1425
13
+ fba_bench_core/benchmarking/metrics/completeness.py,sha256=B1ijofdC8e_NegFwv6cnhHJPAvybYn4ZMTcriyW7Cxw,1132
14
+ fba_bench_core/benchmarking/metrics/cost_efficiency.py,sha256=A4QnIvum8SItcKwq_jyUGt4R0HspA_3XLHmgg92VTlg,1002
15
+ fba_bench_core/benchmarking/metrics/custom_scriptable.py,sha256=VP1mxsWAYaYp11Lbgyje_xccR4sfiCF8n5tqKWJ-7a4,645
16
+ fba_bench_core/benchmarking/metrics/keyword_coverage.py,sha256=KAabbaXChb7nh090hvvyYblQgCHpGJpN3jawFikL9u8,1116
17
+ fba_bench_core/benchmarking/metrics/policy_compliance.py,sha256=spJ_t2crhdb4XAFswQsACnfCktFfXFaBZzxgpknow-Q,618
18
+ fba_bench_core/benchmarking/metrics/registry.py,sha256=0xoD3S6SrAAXEQRfhc4-5knTbmmGifZx8913Oxs9bcY,1471
19
+ fba_bench_core/benchmarking/metrics/robustness.py,sha256=7zOMjFoBK2DxdNSAeGScdh_OLscIn07HIFw3lYJ0KMo,778
20
+ fba_bench_core/benchmarking/metrics/technical_performance.py,sha256=k7Q_gBDlAIxiTp6Z88IjOpZdPTuHkOevSVHWDWJ3SPA,523
21
+ fba_bench_core/benchmarking/registry.py,sha256=odlep3bDNENBfPGK9YlBt1GDCyCvbaqQ9JBek92XHyQ,1383
22
+ fba_bench_core/benchmarking/scenarios/__init__.py,sha256=6ao0MLSoUF4i_LxyJnIfFAAg7Nu9nSRa8emZDO2rBXY,32
23
+ fba_bench_core/benchmarking/scenarios/base.py,sha256=wzOTLqwG6aiSv-Djk4TOjQihpE4yrr6BZSFQW8bfSA8,1061
24
+ fba_bench_core/benchmarking/scenarios/complex_marketplace.py,sha256=YVXqkIAY_HwuR7_UM2UiTyHczRW0pFisU5jBOKZsCbI,6414
25
+ fba_bench_core/benchmarking/scenarios/multiturn_tool_use.py,sha256=ZLiYIyL81uG2vtut0FXw83upcPoB3hz4agw3NqFZpys,6499
26
+ fba_bench_core/benchmarking/scenarios/registry.py,sha256=tMPyO_WrG4QeQkF1NQG8BedjH0I-LwdxivQ7qrgJD28,407
27
+ fba_bench_core/benchmarking/scenarios/research_summarization.py,sha256=GiLQOiCQWOKPxOhGuxpmF5VgnueVtodkaarp0hsmRdc,5077
28
+ fba_bench_core/benchmarking/validators/__init__.py,sha256=V7fiZgpVaHymW9jloB4Bj80Ohb-yQD4Oqlvh_nPFTD0,571
29
+ fba_bench_core/benchmarking/validators/determinism_check.py,sha256=QtVqbHOPat5CMhHwjr2iWk94x9r_TUeLETbxBhVrjPU,3244
30
+ fba_bench_core/benchmarking/validators/fairness_balance.py,sha256=soC3mw_cHm9vWhC5HJnoHeP8dgL-Pk7qB7KHTXVV5Bk,2535
31
+ fba_bench_core/benchmarking/validators/outlier_detection.py,sha256=3oFUQyzcPW6NCm33N83rzavundBj9PXkJuDVEBVRnlM,1576
32
+ fba_bench_core/benchmarking/validators/registry.py,sha256=VXdLZxmVJGUBpvRomQNWJ4lJuucGFviyPJi5cfCQeJw,1586
33
+ fba_bench_core/benchmarking/validators/reproducibility_metadata.py,sha256=rq4_Tup379VXXf6RftEo4thc8yiOEp3YPGlJDFbwriE,2529
34
+ fba_bench_core/benchmarking/validators/schema_adherence.py,sha256=A1qM458czeMDQ-2mrJyJsJAnEgEA0H3rP9OpwySDWDU,2109
35
+ fba_bench_core/benchmarking/validators/structural_consistency.py,sha256=gn_8dsC37lUMU3u_LV7cTvxFeYdBRslP8bAA6CahMe0,2404
36
+ fba_bench_core/config.py,sha256=QI11MsNpvgpTIt-2sU7EU9YmcfaGejE2aja8Ma0bD1s,5772
37
+ fba_bench_core/domain/__init__.py,sha256=Rz9K7s0bxLn6WFEYG0d9Brp80WoRczyqwWal5Nrv5aU,1875
38
+ fba_bench_core/domain/events/__init__.py,sha256=BtwH0cM__GloFJqKhdks79JVh9lWmu9PxZKcq9Ce2oI,6314
39
+ fba_bench_core/domain/events/analytics.py,sha256=QcDPcSJzmc6jbnjIDyeEu_sEtsriHFBrHHJdFw8kZwU,2035
40
+ fba_bench_core/domain/events/base.py,sha256=uosAiiZY_CqksKJnvjMrIqsQhYsUUXHVy3QiE7UwQ9M,2200
41
+ fba_bench_core/domain/events/inventory.py,sha256=h_e6RmvxydRPpKfnbL_OIrNrzypGlyITf0l07ptKYc4,3801
42
+ fba_bench_core/domain/events/marketing.py,sha256=JOTnct1lDVOBM1C9pbVGH54CsrsuPLFlekzM8gRG-4w,3162
43
+ fba_bench_core/domain/events/pricing.py,sha256=mPT34R7WRQNORTRuSDxs-2o0lnlW3SnOeCKbbKDwEwI,6065
44
+ fba_bench_core/domain/models.py,sha256=t9ESz5oDtxVFov0flnBrbneCT2SMWnDwuQl3BN3Us7Y,11489
45
+ fba_bench_core/exceptions/__init__.py,sha256=e2QQu0mJ1JptILUBfa5WEYNtBGNzOdUfYlkVtnKA2cw,303
46
+ fba_bench_core/exceptions/base.py,sha256=D5R72qX1HAvIwzlvoJpl5jf2i-MgahOCIpGeJsdocic,1388
47
+ fba_bench_core/services/__init__.py,sha256=M8mgldXEVKPS1JtK46dNv_WNBjLw7WmTN1BD-W3xsGg,297
48
+ fba_bench_core/services/base.py,sha256=U5HI7Yk-c4RBNJTTg_E9gt_KUQfN0Om-BqVsy-nYFfk,1897
49
+ fba_bench_core-1.0.0.dist-info/licenses/LICENSE,sha256=w-_y1eaTYrejdQvth48gtUvhxEgsEgFRe1JX-BGylSU,1097
50
+ fba_bench_core-1.0.0.dist-info/METADATA,sha256=MD3BlyAZjRekc1Nj6nQZa4m8ihy0pZO27uUPFqHhV4w,5672
51
+ fba_bench_core-1.0.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
52
+ fba_bench_core-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.2.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 FBA-Bench Core Team
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.