iot-fixturekit 0.1.0a2__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 (52) hide show
  1. iot_fixturekit-0.1.0a2/.pre-commit-hooks.yaml +8 -0
  2. iot_fixturekit-0.1.0a2/CHANGELOG.md +17 -0
  3. iot_fixturekit-0.1.0a2/CONTRIBUTING.md +26 -0
  4. iot_fixturekit-0.1.0a2/LICENSE +202 -0
  5. iot_fixturekit-0.1.0a2/MANIFEST.in +24 -0
  6. iot_fixturekit-0.1.0a2/PKG-INFO +237 -0
  7. iot_fixturekit-0.1.0a2/QUICKSTART.md +67 -0
  8. iot_fixturekit-0.1.0a2/README.md +223 -0
  9. iot_fixturekit-0.1.0a2/SECURITY.md +22 -0
  10. iot_fixturekit-0.1.0a2/examples/pilot/OVERKIZ.md +40 -0
  11. iot_fixturekit-0.1.0a2/examples/pilot/TUYA.md +36 -0
  12. iot_fixturekit-0.1.0a2/examples/pilot/overkiz-style-setup.json +23 -0
  13. iot_fixturekit-0.1.0a2/examples/pilot/shelly-style-fixture.json +12 -0
  14. iot_fixturekit-0.1.0a2/examples/pilot/shelly-style-policy.json +10 -0
  15. iot_fixturekit-0.1.0a2/examples/pilot/tuya-loader-diagnostics.json +34 -0
  16. iot_fixturekit-0.1.0a2/examples/synthetic-diagnostics.json +1 -0
  17. iot_fixturekit-0.1.0a2/examples/synthetic-placeholder-policy.json +10 -0
  18. iot_fixturekit-0.1.0a2/examples/synthetic-policy.json +1 -0
  19. iot_fixturekit-0.1.0a2/examples/synthetic-tuya-diagnostics.json +15 -0
  20. iot_fixturekit-0.1.0a2/examples/synthetic-tuya-fixture.json +1 -0
  21. iot_fixturekit-0.1.0a2/integration_tests/test_pytest_plugin.py +58 -0
  22. iot_fixturekit-0.1.0a2/integration_tests/test_shelly_style_pilot.py +36 -0
  23. iot_fixturekit-0.1.0a2/pyproject.toml +31 -0
  24. iot_fixturekit-0.1.0a2/scripts/check_distribution.py +56 -0
  25. iot_fixturekit-0.1.0a2/scripts/map_dependencies.py +60 -0
  26. iot_fixturekit-0.1.0a2/scripts/survey_core.py +78 -0
  27. iot_fixturekit-0.1.0a2/setup.cfg +4 -0
  28. iot_fixturekit-0.1.0a2/src/iot_fixturekit/__init__.py +4 -0
  29. iot_fixturekit-0.1.0a2/src/iot_fixturekit/audit.py +191 -0
  30. iot_fixturekit-0.1.0a2/src/iot_fixturekit/cli.py +57 -0
  31. iot_fixturekit-0.1.0a2/src/iot_fixturekit/core.py +118 -0
  32. iot_fixturekit-0.1.0a2/src/iot_fixturekit/policy.py +39 -0
  33. iot_fixturekit-0.1.0a2/src/iot_fixturekit/pytest_plugin.py +26 -0
  34. iot_fixturekit-0.1.0a2/src/iot_fixturekit/tuya.py +86 -0
  35. iot_fixturekit-0.1.0a2/src/iot_fixturekit.egg-info/PKG-INFO +237 -0
  36. iot_fixturekit-0.1.0a2/src/iot_fixturekit.egg-info/SOURCES.txt +50 -0
  37. iot_fixturekit-0.1.0a2/src/iot_fixturekit.egg-info/dependency_links.txt +1 -0
  38. iot_fixturekit-0.1.0a2/src/iot_fixturekit.egg-info/entry_points.txt +7 -0
  39. iot_fixturekit-0.1.0a2/src/iot_fixturekit.egg-info/requires.txt +3 -0
  40. iot_fixturekit-0.1.0a2/src/iot_fixturekit.egg-info/top_level.txt +1 -0
  41. iot_fixturekit-0.1.0a2/tests/golden/cz_DemoPlug01.json +22 -0
  42. iot_fixturekit-0.1.0a2/tests/test_audit.py +75 -0
  43. iot_fixturekit-0.1.0a2/tests/test_audit_file.py +23 -0
  44. iot_fixturekit-0.1.0a2/tests/test_audit_resources.py +34 -0
  45. iot_fixturekit-0.1.0a2/tests/test_core.py +94 -0
  46. iot_fixturekit-0.1.0a2/tests/test_input_hardening.py +64 -0
  47. iot_fixturekit-0.1.0a2/tests/test_map_dependencies.py +33 -0
  48. iot_fixturekit-0.1.0a2/tests/test_overkiz_profile.py +67 -0
  49. iot_fixturekit-0.1.0a2/tests/test_policy.py +79 -0
  50. iot_fixturekit-0.1.0a2/tests/test_policy_tree.py +42 -0
  51. iot_fixturekit-0.1.0a2/tests/test_survey_core.py +27 -0
  52. iot_fixturekit-0.1.0a2/tests/test_tuya.py +117 -0
@@ -0,0 +1,8 @@
1
+ - id: iot-fixture-audit
2
+ name: Audit IoT test fixtures
3
+ description: Local heuristic audit; reports rule IDs without matching values.
4
+ entry: iot-fixture-audit
5
+ language: python
6
+ types: [text]
7
+ files: '(^|/)(fixtures|golden)/.*\.(json|har|xml|jsonl|log|txt)$'
8
+ require_serial: true
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0a2 (2026-12-01)
4
+
5
+ - Add an opt-in Overkiz audit profile for selected serial, network and HomeKit setup states.
6
+ - Keep generic and Tuya auditing unchanged; MAC placeholder exceptions cannot waive Overkiz semantic checks.
7
+ - Add ten unit tests and one installed-plugin test for the new profile.
8
+ - Document narrowly scoped Tuya and Overkiz compatibility pilots.
9
+
10
+ The profile is not a complete Overkiz schema validator or a privacy guarantee.
11
+ Use upstream masking and manual review before sharing. Independent security
12
+ review is pending.
13
+
14
+ ## 0.1.0a1 (2026-12-01)
15
+
16
+ Initial experimental alpha: local fixture projection, heuristic auditing,
17
+ Tuya diagnostics conversion, pytest and pre-commit integration.
@@ -0,0 +1,26 @@
1
+ # Contributing
2
+
3
+ FixtureKit welcomes independently reviewed contributions that address a real
4
+ test-fixture workflow. All examples and regression tests must be synthetic
5
+ or accompanied by explicit permission and a documented privacy review.
6
+
7
+ - Start with a small, reproducible problem and explain why existing tooling
8
+ does not already solve it.
9
+ - Keep protocol-specific behavior narrowly scoped. Do not weaken default
10
+ audit rules to silence a test.
11
+ - Include tests for accepted and rejected inputs, error behavior and
12
+ non-disclosure. Never commit raw device diagnostics, private identifiers
13
+ or credentials.
14
+ - Run the standard tests and installed-package integration tests:
15
+
16
+ PYTHONPATH=src python -m unittest discover -s tests
17
+ python -m pip install '.[pytest]' pre-commit
18
+ python -m pytest integration_tests -q
19
+ pre-commit validate-manifest .pre-commit-hooks.yaml
20
+
21
+ - Review AI-assisted changes yourself and be able to explain them. Respect
22
+ upstream projects' contribution and AI policies. Do not submit autonomous
23
+ issues, pull requests or comments to third-party projects.
24
+
25
+ See SECURITY.md for suspected vulnerabilities. Contributions do not imply
26
+ that any fixture is certified safe to share.
@@ -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,24 @@
1
+ include README.md
2
+ include .pre-commit-hooks.yaml
3
+ recursive-include examples *.json
4
+ recursive-include tests *.py *.json
5
+ recursive-include integration_tests *.py
6
+ include SECURITY.md
7
+ prune raw
8
+ global-exclude *.py[cod]
9
+ global-exclude *.private.json
10
+ include scripts/survey_core.py
11
+ include scripts/map_dependencies.py
12
+ prune docs
13
+ prune research
14
+ include scripts/check_distribution.py
15
+
16
+ include LICENSE
17
+
18
+ include QUICKSTART.md CONTRIBUTING.md
19
+
20
+ include examples/pilot/TUYA.md
21
+
22
+ include examples/pilot/OVERKIZ.md
23
+
24
+ include CHANGELOG.md
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.4
2
+ Name: iot-fixturekit
3
+ Version: 0.1.0a2
4
+ Summary: Local-first, schema-driven IoT diagnostic fixture tooling
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/FlyzDev/fixturekit
7
+ Project-URL: Issues, https://github.com/FlyzDev/fixturekit/issues
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Provides-Extra: pytest
12
+ Requires-Dist: pytest>=7; extra == "pytest"
13
+ Dynamic: license-file
14
+
15
+ # IoT FixtureKit
16
+
17
+ **Experimental local-first tooling for converting IoT diagnostics into
18
+ reproducible test fixtures.** No network access, no telemetry, no automatic uploads.
19
+
20
+ Home Assistant integration authors frequently need real device behavior to
21
+ write regression tests. Different projects maintain their own diagnostic-to-fixture
22
+ workflows. This experiment tests whether an explicit projection engine can reduce
23
+ that maintenance without replacing their existing protocol libraries or tests.
24
+
25
+ **Alpha preview (0.1.0a2).** Independent security review is pending.
26
+ No privacy certification or upstream endorsement is claimed.
27
+
28
+ ## Install the published alpha
29
+
30
+ In a virtual environment (Python 3.9+):
31
+
32
+ python -m pip install "https://github.com/FlyzDev/fixturekit/releases/download/v0.1.0a2/iot_fixturekit-0.1.0a2-py3-none-any.whl"
33
+
34
+ [Release files and SHA256 checksums](https://github.com/FlyzDev/fixturekit/releases/tag/v0.1.0a2).
35
+ PyPI publication is pending. The optional pytest integration can be installed
36
+ with the corresponding direct reference:
37
+
38
+ python -m pip install "iot-fixturekit[pytest] @ https://github.com/FlyzDev/fixturekit/releases/download/v0.1.0a2/iot_fixturekit-0.1.0a2-py3-none-any.whl"
39
+
40
+ ## Start here
41
+
42
+ See [QUICKSTART.md](QUICKSTART.md) for installation and the five-minute local
43
+ consumer demo; see [CONTRIBUTING.md](CONTRIBUTING.md) for pilot feedback.
44
+
45
+ ## Run the synthetic demo
46
+
47
+ Python 3.9+; no runtime dependencies.
48
+
49
+ PYTHONPATH=src python3 -m iot_fixturekit.cli examples/synthetic-diagnostics.json --policy examples/synthetic-policy.json --profile demo
50
+
51
+ PYTHONPATH=src python3 -m unittest discover -s tests -v
52
+
53
+ Unknown object fields are excluded. Selected strings must match declared enum
54
+ values. Numbers require explicit bounds. Invalid input is rejected.
55
+ The complete projection policy is validated before use, even for empty arrays.
56
+ Policies are limited to 64 nested levels and 10,000 rules.
57
+ The output is versioned and deterministic.
58
+
59
+ ## Important security boundary
60
+
61
+ This is NOT a complete anonymizer, secret scanner, or privacy guarantee.
62
+ A poorly designed policy can retain sensitive values, keys or measurements.
63
+ Review policy semantics and output locally before sharing. Do not commit raw
64
+ diagnostics, credentials, real device identifiers or customer data. No live
65
+ device adapters are implemented yet. All examples are synthetic.
66
+
67
+ ## Pilot validation
68
+
69
+ Start with maintainer-approved, narrowly scoped adapters for existing fixture
70
+ workflows. Do not request upstream adoption until compatibility and maintenance
71
+ benefit have been demonstrated. Research notes are maintained separately in the repository.
72
+
73
+ ## Fixture audit (experimental)
74
+
75
+ Run on an already-reviewed candidate fixture, not as a replacement for redaction:
76
+
77
+ PYTHONPATH=src python3 -m iot_fixturekit.audit --profile tuya examples/synthetic-tuya-fixture.json
78
+
79
+ Generic mode checks JSON/HAR structures and plain-text patterns (including XML).
80
+ Tuya mode additionally checks selected requirements documented by Tuya Device
81
+ Handlers. Reports contain file ordinals, rule IDs and line numbers (0 for JSON
82
+ structural checks), not paths or matched values. Exit 0 means no findings, 1
83
+ means findings, 2 means an input error. A clean result does NOT certify privacy.
84
+ Unknown secrets, encoded strings, device identifiers and context-specific
85
+ sensitive measurements may remain. Generic mode does not parse XML or JSONL
86
+ structurally. No upstream adoption is claimed.
87
+
88
+ ## Tuya diagnostics adapter (experimental)
89
+
90
+ Create a **local review candidate**, not a publication-ready fixture:
91
+
92
+ mkdir -p raw/review
93
+ PYTHONPATH=src python3 -m iot_fixturekit.tuya examples/synthetic-tuya-diagnostics.json --output-dir raw/review
94
+
95
+ The adapter follows the documented Tuya Device Handlers extraction convention:
96
+ it selects the diagnostics data object, drops account-specific root keys,
97
+ blanks device_info, preserves functional datapoints and preserves the case of
98
+ the product ID. Filename components are restricted to safe alphanumeric forms.
99
+ The candidate is audited before writing, created with exclusive access (no
100
+ overwrite) and restrictive POSIX permissions. Review every field manually
101
+ before sharing; unknown datapoints, device names, timestamps and encoded values
102
+ may still contain personal data. The CLI never prints candidate values.
103
+ Exit 1 indicates audit findings; exit 2 indicates invalid input or write failure.
104
+ The ignored raw/ folder is recommended for private local work.
105
+
106
+ ## Pytest integration
107
+
108
+ Install the package with its optional pytest extra. The pytest entry point
109
+ automatically registers the callable fixture:
110
+
111
+ ```python
112
+ def test_device_fixture(iot_fixture_check):
113
+ iot_fixture_check("tests/fixtures/device.json", profile="tuya")
114
+ ```
115
+
116
+ Use the default generic profile for other devices. Explicitly parametrize the
117
+ files you want checked; there is no automatic repository-wide scanning.
118
+ The plugin uses the same file audit as the CLI and reports only rule IDs.
119
+ Avoid pytest options or custom plugins that dump sensitive local variables.
120
+
121
+ ## Pre-commit integration
122
+
123
+ For a local checkout of the package, use a local hook after installing it in
124
+ the environment running pre-commit:
125
+
126
+ ```yaml
127
+ repos:
128
+ - repo: local
129
+ hooks:
130
+ - id: iot-fixture-audit
131
+ name: Audit IoT test fixtures
132
+ entry: iot-fixture-audit
133
+ language: system
134
+ types: [text]
135
+ files: '(^|/)(fixtures|golden)/.*\.(json|har|xml|jsonl|log|txt)$'
136
+ ```
137
+
138
+ Consumers can also use the public hook pinned to the alpha release:
139
+
140
+ ```yaml
141
+ repos:
142
+ - repo: https://github.com/FlyzDev/fixturekit
143
+ rev: v0.1.0a2
144
+ hooks:
145
+ - id: iot-fixture-audit
146
+ ``` Restrict the file
147
+ pattern to reviewed fixture directories; use separate hooks with
148
+ `args: [--profile, tuya]` where appropriate. No findings is not a privacy
149
+ guarantee, and a hook is not a substitute for human review.
150
+
151
+ ## Project-specific placeholder policies (experimental)
152
+
153
+ Some libraries intentionally preserve synthetic MAC addresses in test fixtures.
154
+ Use an explicitly reviewed JSON policy, such as
155
+ `examples/synthetic-placeholder-policy.json`, with the audit CLI:
156
+
157
+ iot-fixture-audit --policy examples/synthetic-placeholder-policy.json tests/fixtures/device.json
158
+
159
+ Pytest accepts the same file through `policy_path`; pre-commit can pass
160
+ `args: [--policy, path/to/policy.json]` on a JSON-only hook.
161
+ For Python callers, pass the parsed policy via the keyword-only `policy`
162
+ argument to `audit_json` or `audit_file`.
163
+
164
+ Version 1 supports exact typed JSON paths and exact full colon-delimited MAC
165
+ placeholder values only. Integer path segments select array indexes; strings
166
+ select object keys. No wildcard or regex exemptions, no credential-rule
167
+ exemptions, and no exemption of object keys or Tuya structural checks.
168
+ Policies are opt-in; the Tuya conversion CLI retains its original strict audit.
169
+ Text formats do not accept policies. Keep policy files human-reviewed and use
170
+ only known synthetic values, never actual device addresses. A policy is not
171
+ evidence that a fixture is safe to publish.
172
+
173
+ Audit inputs are limited to 8 MiB per file, 64 nested path segments and
174
+ 200,000 visited JSON nodes (including object keys). The JSON audit rejects
175
+ non-finite numbers, unsupported Python values and unpaired Unicode surrogates.
176
+ These are defensive limits, not a complete resource-isolation guarantee.
177
+
178
+ Text audit additionally limits input to 8,388,608 characters and output to
179
+ 4,096 distinct line/rule findings per audit_text call. Exceeding a limit
180
+ is an input error, never a clean scan. Email and JWT matching starts at
181
+ token boundaries to avoid repeatedly scanning long runs of punctuation
182
+ or token characters. These heuristics can miss unusual or embedded values.
183
+
184
+ ## License
185
+
186
+ Apache License 2.0. See LICENSE.
187
+
188
+ ## Tuya loader compatibility pilot
189
+
190
+ A generated synthetic fixture was successfully loaded by the pinned upstream
191
+ Tuya Device Handlers test helper using the published alpha. See
192
+ [the reproducible pilot](examples/pilot/TUYA.md) for the exact scope and checks.
193
+
194
+ ## Overkiz profile (experimental)
195
+
196
+ The opt-in JSON profile checks selected exact state names for unmasked
197
+ values, including serial numbers, network identifiers and HomeKit setup
198
+ states. It recognizes limited mask-only strings and explicit redaction
199
+ placeholders; it does not validate all Overkiz fields or prove privacy.
200
+ Use the upstream obfuscator first. Generic mode is unchanged.
201
+
202
+ iot-fixture-audit --profile overkiz tests/fixtures/setup/device.json
203
+
204
+ Pytest accepts profile="overkiz", and JSON pre-commit hooks can pass
205
+ args: [--profile, overkiz]. MAC placeholder exceptions do not suppress
206
+ semantic state findings. This profile is included in the 0.1.0a2 alpha.
207
+
208
+ ## Overkiz post-obfuscation pilot
209
+
210
+ The published alpha was tested as an additional non-mutating check after
211
+ the pinned pyoverkiz obfuscator. See [the pilot and its known gap](examples/pilot/OVERKIZ.md).
212
+
213
+ ## Synthetic consumer pilot
214
+
215
+ The examples/pilot directory illustrates a fixture convention used by a
216
+ device library: a fixed synthetic Wi-Fi MAC placeholder at status.wifi.mac.
217
+ The example is independently constructed, incomplete and not an upstream
218
+ fixture or a compatibility guarantee.
219
+
220
+ After installing the package in a separate project, a JSON-only pre-commit
221
+ hook can pass the checked-in policy path as an argument:
222
+
223
+ ```yaml
224
+ repos:
225
+ - repo: local
226
+ hooks:
227
+ - id: fixturekit
228
+ name: FixtureKit audit
229
+ entry: iot-fixture-audit
230
+ language: system
231
+ args: [--policy, examples/pilot/shelly-style-policy.json]
232
+ files: '^tests/fixtures/.*\.json$'
233
+ ```
234
+
235
+ Use the matching policy in pytest via policy_path. Keep policies under human
236
+ review and do not apply the exception globally. This supplements, rather
237
+ than replaces, device-library redactors. See the four pilot integration tests.
@@ -0,0 +1,67 @@
1
+ # Try FixtureKit in five minutes
2
+
3
+ This is an experimental developer utility, not a Home Assistant integration.
4
+ It checks local test fixtures and can convert a Tuya diagnostics download into
5
+ a local review candidate. No account, cloud service or device access required.
6
+
7
+ ## Install the published alpha
8
+
9
+ In a virtual environment:
10
+
11
+ python -m pip install "https://github.com/FlyzDev/fixturekit/releases/download/v0.1.0a2/iot_fixturekit-0.1.0a2-py3-none-any.whl"
12
+
13
+ To follow the synthetic examples, clone the public source at the release tag:
14
+
15
+ git clone --branch v0.1.0a2 https://github.com/FlyzDev/fixturekit.git
16
+ cd fixturekit
17
+
18
+ The release page includes SHA256 checksums. PyPI publication is pending.
19
+
20
+ ## Alternatively, install from source
21
+
22
+ From a checkout of https://github.com/FlyzDev/fixturekit:
23
+
24
+ python -m venv .venv
25
+ . .venv/bin/activate
26
+ python -m pip install '.[pytest]'
27
+
28
+ Windows: activate with the appropriate script under .venv/Scripts.
29
+ A PyPI release is not yet available.
30
+
31
+ ## First successful check
32
+
33
+ iot-fixture-audit --profile tuya examples/synthetic-tuya-fixture.json
34
+
35
+ Exit 0 means no findings under these limited rules, not that data is safe to share.
36
+
37
+ ## Convert a synthetic diagnostic
38
+
39
+ mkdir -p raw/review
40
+ iot-fixture-tuya examples/synthetic-tuya-diagnostics.json --output-dir raw/review
41
+ iot-fixture-audit --profile tuya raw/review/cz_DemoPlug01.json
42
+
43
+ Review every field before sharing any real diagnostic. Never commit raw inputs.
44
+ The converter refuses to overwrite existing files.
45
+
46
+ ## Add a check to your own tests
47
+
48
+ After installing the optional pytest extra:
49
+
50
+ ```python
51
+ def test_device_fixture(iot_fixture_check):
52
+ iot_fixture_check("tests/fixtures/device.json", profile="tuya")
53
+ ```
54
+
55
+ Use the generic profile for non-Tuya data. An explicit JSON policy can permit
56
+ a known synthetic MAC placeholder at one specific field (see examples/pilot).
57
+ Do not copy real identifiers into policies.
58
+
59
+ ## Tell us whether it helped
60
+
61
+ Try only synthetic or explicitly authorized inputs. Report the workflow,
62
+ expected behavior, rule IDs, Python version, and a minimal synthetic sample.
63
+ Do not attach actual device diagnostics or private identifiers. For a suspected
64
+ security issue, follow SECURITY.md rather than a public issue.
65
+
66
+ Useful pilot feedback: setup time, number of manual operations avoided,
67
+ false positives, missed checks, and whether the existing tests still pass.