bugstack 1.1.0__tar.gz → 1.2.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 (40) hide show
  1. {bugstack-1.1.0 → bugstack-1.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +23 -23
  2. {bugstack-1.1.0 → bugstack-1.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +17 -17
  3. {bugstack-1.1.0 → bugstack-1.2.0}/.github/PULL_REQUEST_TEMPLATE.md +10 -10
  4. {bugstack-1.1.0 → bugstack-1.2.0}/.github/workflows/ci.yml +36 -36
  5. {bugstack-1.1.0 → bugstack-1.2.0}/.github/workflows/publish.yml +32 -32
  6. {bugstack-1.1.0 → bugstack-1.2.0}/.gitignore +37 -37
  7. {bugstack-1.1.0 → bugstack-1.2.0}/CHANGELOG.md +30 -36
  8. {bugstack-1.1.0 → bugstack-1.2.0}/CONTRIBUTING.md +46 -46
  9. {bugstack-1.1.0 → bugstack-1.2.0}/LICENSE +21 -21
  10. {bugstack-1.1.0 → bugstack-1.2.0}/PKG-INFO +14 -13
  11. {bugstack-1.1.0 → bugstack-1.2.0}/README.md +173 -171
  12. {bugstack-1.1.0 → bugstack-1.2.0}/SECURITY.md +25 -25
  13. {bugstack-1.1.0 → bugstack-1.2.0}/examples/basic_usage.py +29 -29
  14. {bugstack-1.1.0 → bugstack-1.2.0}/examples/django_example/settings.py +15 -15
  15. {bugstack-1.1.0 → bugstack-1.2.0}/examples/fastapi_example/main.py +29 -29
  16. {bugstack-1.1.0 → bugstack-1.2.0}/examples/flask_example/main.py +29 -29
  17. {bugstack-1.1.0 → bugstack-1.2.0}/pyproject.toml +75 -76
  18. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/__init__.py +142 -142
  19. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/client.py +151 -158
  20. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/fingerprint.py +96 -96
  21. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/integrations/__init__.py +5 -5
  22. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/integrations/django.py +93 -93
  23. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/integrations/fastapi.py +94 -94
  24. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/integrations/flask.py +57 -57
  25. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/integrations/generic.py +71 -71
  26. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/transport.py +171 -198
  27. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/types.py +108 -108
  28. {bugstack-1.1.0 → bugstack-1.2.0}/tests/conftest.py +37 -37
  29. {bugstack-1.1.0 → bugstack-1.2.0}/tests/helpers.py +9 -9
  30. {bugstack-1.1.0 → bugstack-1.2.0}/tests/integrations/django_settings.py +12 -12
  31. {bugstack-1.1.0 → bugstack-1.2.0}/tests/integrations/test_django.py +77 -77
  32. {bugstack-1.1.0 → bugstack-1.2.0}/tests/integrations/test_fastapi.py +74 -74
  33. {bugstack-1.1.0 → bugstack-1.2.0}/tests/integrations/test_flask.py +63 -63
  34. {bugstack-1.1.0 → bugstack-1.2.0}/tests/integrations/test_generic.py +73 -73
  35. {bugstack-1.1.0 → bugstack-1.2.0}/tests/test_client.py +187 -187
  36. {bugstack-1.1.0 → bugstack-1.2.0}/tests/test_fingerprint.py +137 -137
  37. {bugstack-1.1.0 → bugstack-1.2.0}/tests/test_init.py +106 -106
  38. {bugstack-1.1.0 → bugstack-1.2.0}/tests/test_transport.py +153 -153
  39. {bugstack-1.1.0 → bugstack-1.2.0}/tests/test_types.py +139 -139
  40. {bugstack-1.1.0 → bugstack-1.2.0}/src/bugstack/py.typed +0 -0
@@ -1,23 +1,23 @@
1
- ---
2
- name: Bug Report
3
- about: Report a bug in the BugStack Python SDK
4
- title: "[Bug] "
5
- labels: bug
6
- ---
7
-
8
- **Describe the bug**
9
- A clear description of what the bug is.
10
-
11
- **To Reproduce**
12
- ```python
13
- # Minimal code to reproduce
14
- ```
15
-
16
- **Expected behavior**
17
- What you expected to happen.
18
-
19
- **Environment**
20
- - Python version:
21
- - SDK version:
22
- - Framework (if applicable):
23
- - OS:
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug in the Bugstack Python SDK
4
+ title: "[Bug] "
5
+ labels: bug
6
+ ---
7
+
8
+ **Describe the bug**
9
+ A clear description of what the bug is.
10
+
11
+ **To Reproduce**
12
+ ```python
13
+ # Minimal code to reproduce
14
+ ```
15
+
16
+ **Expected behavior**
17
+ What you expected to happen.
18
+
19
+ **Environment**
20
+ - Python version:
21
+ - SDK version:
22
+ - Framework (if applicable):
23
+ - OS:
@@ -1,17 +1,17 @@
1
- ---
2
- name: Feature Request
3
- about: Suggest a feature for the BugStack Python SDK
4
- title: "[Feature] "
5
- labels: enhancement
6
- ---
7
-
8
- **Describe the feature**
9
- A clear description of what you'd like.
10
-
11
- **Use case**
12
- Why is this feature useful? What problem does it solve?
13
-
14
- **Proposed API**
15
- ```python
16
- # How would you like to use this feature?
17
- ```
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a feature for the Bugstack Python SDK
4
+ title: "[Feature] "
5
+ labels: enhancement
6
+ ---
7
+
8
+ **Describe the feature**
9
+ A clear description of what you'd like.
10
+
11
+ **Use case**
12
+ Why is this feature useful? What problem does it solve?
13
+
14
+ **Proposed API**
15
+ ```python
16
+ # How would you like to use this feature?
17
+ ```
@@ -1,10 +1,10 @@
1
- ## Summary
2
-
3
- <!-- What does this PR do? -->
4
-
5
- ## Test Plan
6
-
7
- - [ ] Tests added/updated
8
- - [ ] All tests pass (`pytest`)
9
- - [ ] Linting passes (`ruff check .`)
10
- - [ ] Type checking passes (`mypy src/bugstack`)
1
+ ## Summary
2
+
3
+ <!-- What does this PR do? -->
4
+
5
+ ## Test Plan
6
+
7
+ - [ ] Tests added/updated
8
+ - [ ] All tests pass (`pytest`)
9
+ - [ ] Linting passes (`ruff check .`)
10
+ - [ ] Type checking passes (`mypy src/bugstack`)
@@ -1,36 +1,36 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- branches: [main]
8
-
9
- jobs:
10
- test:
11
- runs-on: ubuntu-latest
12
- strategy:
13
- matrix:
14
- python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15
-
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - name: Set up Python ${{ matrix.python-version }}
20
- uses: actions/setup-python@v5
21
- with:
22
- python-version: ${{ matrix.python-version }}
23
-
24
- - name: Install dependencies
25
- run: |
26
- python -m pip install --upgrade pip
27
- pip install -e ".[dev]"
28
-
29
- - name: Lint
30
- run: ruff check .
31
-
32
- - name: Type check
33
- run: mypy src/bugstack --ignore-missing-imports
34
-
35
- - name: Test
36
- run: pytest -v
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev]"
28
+
29
+ - name: Lint
30
+ run: ruff check .
31
+
32
+ - name: Type check
33
+ run: mypy src/bugstack --ignore-missing-imports
34
+
35
+ - name: Test
36
+ run: pytest -v
@@ -1,32 +1,32 @@
1
- name: Publish to PyPI
2
-
3
- on:
4
- release:
5
- types: [published]
6
-
7
- permissions:
8
- id-token: write
9
-
10
- jobs:
11
- publish:
12
- runs-on: ubuntu-latest
13
- environment: pypi
14
-
15
- steps:
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
- pip install build
27
-
28
- - name: Build package
29
- run: python -m build
30
-
31
- - name: Publish to PyPI
32
- uses: pypa/gh-action-pypi-publish@release/v1
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+ environment: pypi
14
+
15
+ steps:
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
+ pip install build
27
+
28
+ - name: Build package
29
+ run: python -m build
30
+
31
+ - name: Publish to PyPI
32
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -1,37 +1,37 @@
1
- __pycache__/
2
- *.py[cod]
3
- *$py.class
4
- *.so
5
- *.egg
6
- *.egg-info/
7
- dist/
8
- build/
9
- .eggs/
10
- *.whl
11
-
12
- # Virtual environments
13
- .venv/
14
- venv/
15
- env/
16
- ENV/
17
-
18
- # IDE
19
- .idea/
20
- .vscode/
21
- *.swp
22
- *.swo
23
-
24
- # Testing
25
- .pytest_cache/
26
- .coverage
27
- htmlcov/
28
- .mypy_cache/
29
- .ruff_cache/
30
-
31
- # OS
32
- .DS_Store
33
- Thumbs.db
34
-
35
- # Environment
36
- .env
37
- .env.local
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ *.egg
6
+ *.egg-info/
7
+ dist/
8
+ build/
9
+ .eggs/
10
+ *.whl
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+ ENV/
17
+
18
+ # IDE
19
+ .idea/
20
+ .vscode/
21
+ *.swp
22
+ *.swo
23
+
24
+ # Testing
25
+ .pytest_cache/
26
+ .coverage
27
+ htmlcov/
28
+ .mypy_cache/
29
+ .ruff_cache/
30
+
31
+ # OS
32
+ .DS_Store
33
+ Thumbs.db
34
+
35
+ # Environment
36
+ .env
37
+ .env.local
@@ -1,36 +1,30 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## [1.1.0] - 2026-03-02
6
-
7
- ### Fixed
8
-
9
- - **Fork-safe transport**: Background worker thread now automatically restarts
10
- after `os.fork()`, fixing silent event loss under Gunicorn, uWSGI, and other
11
- prefork WSGI servers.
12
- - **Worker loop resilience**: Unexpected exceptions in the worker loop are now
13
- caught and logged instead of silently killing the thread.
14
- - **Debug logging under WSGI servers**: Replaced `logging.basicConfig()` (which
15
- is a no-op when the root logger is already configured by Gunicorn/uWSGI) with
16
- a direct handler on the `bugstack` logger.
17
-
18
- ### Added
19
-
20
- - Python 3.14 support (tested and confirmed).
21
-
22
- ## [1.0.0] - 2026-02-13
23
-
24
- ### Added
25
-
26
- - Core SDK with `bugstack.init()` and `bugstack.capture_exception()`
27
- - Background HTTP transport with retry and exponential backoff
28
- - SHA-256 error fingerprinting and client-side deduplication
29
- - `before_send` hook for event inspection/modification/filtering
30
- - `ignored_errors` for skipping specific error types or messages
31
- - `dry_run` mode for transparent debugging
32
- - `enabled` kill switch
33
- - FastAPI middleware integration
34
- - Django middleware integration with auto-init from settings
35
- - Flask integration via `init_app()`
36
- - Generic integration via `sys.excepthook` and `threading.excepthook`
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.2.0] - 2026-10-28
6
+
7
+ ### Fixed
8
+
9
+ - The default endpoint is now `https://dashboard.bugstack.ai/api/ingest/sdk`.
10
+ It was `https://api.bugstack.dev/api/capture`, which is not Bugstack's
11
+ ingest address, so events sent with the default setting did not reach
12
+ Bugstack. Apps that pass `endpoint=` themselves are unaffected.
13
+ - The package's homepage, documentation, repository and contact links now
14
+ point at bugstack.ai and github.com/Bugstackai/Bugstack-SDK-Python.
15
+
16
+ ## [1.0.0] - 2026-02-13
17
+
18
+ ### Added
19
+
20
+ - Core SDK with `bugstack.init()` and `bugstack.capture_exception()`
21
+ - Background HTTP transport with retry and exponential backoff
22
+ - SHA-256 error fingerprinting and client-side deduplication
23
+ - `before_send` hook for event inspection/modification/filtering
24
+ - `ignored_errors` for skipping specific error types or messages
25
+ - `dry_run` mode for transparent debugging
26
+ - `enabled` kill switch
27
+ - FastAPI middleware integration
28
+ - Django middleware integration with auto-init from settings
29
+ - Flask integration via `init_app()`
30
+ - Generic integration via `sys.excepthook` and `threading.excepthook`
@@ -1,46 +1,46 @@
1
- # Contributing to bugstack-python
2
-
3
- Thank you for your interest in contributing!
4
-
5
- ## Development Setup
6
-
7
- ```bash
8
- git clone https://github.com/MasonBachmann7/bugstack-python.git
9
- cd bugstack-python
10
- python -m venv .venv
11
- source .venv/bin/activate # or .venv\Scripts\activate on Windows
12
- pip install -e ".[dev]"
13
- ```
14
-
15
- ## Running Tests
16
-
17
- ```bash
18
- pytest
19
- ```
20
-
21
- ## Code Style
22
-
23
- We use [Ruff](https://docs.astral.sh/ruff/) for linting and formatting:
24
-
25
- ```bash
26
- ruff check .
27
- ruff format .
28
- ```
29
-
30
- ## Type Checking
31
-
32
- ```bash
33
- mypy src/bugstack
34
- ```
35
-
36
- ## Pull Requests
37
-
38
- 1. Fork the repo and create your branch from `main`
39
- 2. Add tests for any new functionality
40
- 3. Ensure all tests pass
41
- 4. Run the linter and type checker
42
- 5. Submit your PR
43
-
44
- ## Reporting Issues
45
-
46
- Use [GitHub Issues](https://github.com/MasonBachmann7/bugstack-python/issues) to report bugs or request features.
1
+ # Contributing to bugstack-python
2
+
3
+ Thank you for your interest in contributing!
4
+
5
+ ## Development Setup
6
+
7
+ ```bash
8
+ git clone https://github.com/Bugstackai/Bugstack-SDK-Python.git
9
+ cd bugstack-python
10
+ python -m venv .venv
11
+ source .venv/bin/activate # or .venv\Scripts\activate on Windows
12
+ pip install -e ".[dev]"
13
+ ```
14
+
15
+ ## Running Tests
16
+
17
+ ```bash
18
+ pytest
19
+ ```
20
+
21
+ ## Code Style
22
+
23
+ We use [Ruff](https://docs.astral.sh/ruff/) for linting and formatting:
24
+
25
+ ```bash
26
+ ruff check .
27
+ ruff format .
28
+ ```
29
+
30
+ ## Type Checking
31
+
32
+ ```bash
33
+ mypy src/bugstack
34
+ ```
35
+
36
+ ## Pull Requests
37
+
38
+ 1. Fork the repo and create your branch from `main`
39
+ 2. Add tests for any new functionality
40
+ 3. Ensure all tests pass
41
+ 4. Run the linter and type checker
42
+ 5. Submit your PR
43
+
44
+ ## Reporting Issues
45
+
46
+ Use [GitHub Issues](https://github.com/Bugstackai/Bugstack-SDK-Python/issues) to report bugs or request features.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 BugStack
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
+ MIT License
2
+
3
+ Copyright (c) 2026 BugStack
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,16 +1,16 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: bugstack
3
- Version: 1.1.0
4
- Summary: Official BugStack SDK for Python — capture, report, and auto-fix production errors.
5
- Project-URL: Homepage, https://bugstack.dev
6
- Project-URL: Documentation, https://docs.bugstack.dev/sdks/python
7
- Project-URL: Repository, https://github.com/MasonBachmann7/bugstack-python
8
- Project-URL: Issues, https://github.com/MasonBachmann7/bugstack-python/issues
9
- Project-URL: Changelog, https://github.com/MasonBachmann7/bugstack-python/blob/main/CHANGELOG.md
10
- Author-email: BugStack <team@bugstack.dev>
3
+ Version: 1.2.0
4
+ Summary: The Bugstack SDK for Python. Reports uncaught server errors from Django, Flask and FastAPI to Bugstack, autonomous software maintenance.
5
+ Project-URL: Homepage, https://bugstack.ai
6
+ Project-URL: Documentation, https://bugstack.ai/docs/sdk/python
7
+ Project-URL: Repository, https://github.com/Bugstackai/Bugstack-SDK-Python
8
+ Project-URL: Issues, https://github.com/Bugstackai/Bugstack-SDK-Python/issues
9
+ Project-URL: Changelog, https://github.com/Bugstackai/Bugstack-SDK-Python/blob/main/CHANGELOG.md
10
+ Author-email: BugStack <support@bugstack.ai>
11
11
  License-Expression: MIT
12
12
  License-File: LICENSE
13
- Keywords: auto-fix,bugstack,debugging,error-tracking,monitoring
13
+ Keywords: autonomous-software-maintenance,bugstack,django,error-reporting,fastapi,flask,software-maintenance
14
14
  Classifier: Development Status :: 5 - Production/Stable
15
15
  Classifier: Intended Audience :: Developers
16
16
  Classifier: License :: OSI Approved :: MIT License
@@ -20,7 +20,6 @@ Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Programming Language :: Python :: 3.14
24
23
  Classifier: Topic :: Software Development :: Bug Tracking
25
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
25
  Classifier: Typing :: Typed
@@ -46,7 +45,9 @@ Description-Content-Type: text/markdown
46
45
 
47
46
  # bugstack-python
48
47
 
49
- Official Python SDK for [BugStack](https://bugstack.dev) — capture, report, and auto-fix production errors.
48
+ The [Bugstack](https://bugstack.ai) SDK for Python: Django, Flask and FastAPI.
49
+
50
+ Bugstack is autonomous software maintenance. It watches your app and your repository, fixes what breaks, and sends every change as a pull request you control. This SDK is how your app tells Bugstack about an uncaught server error.
50
51
 
51
52
  [![PyPI](https://img.shields.io/pypi/v/bugstack)](https://pypi.org/project/bugstack/)
52
53
  [![Python](https://img.shields.io/pypi/pyversions/bugstack)](https://pypi.org/project/bugstack/)
@@ -124,7 +125,7 @@ install_hooks()
124
125
  bugstack.init(
125
126
  api_key="bs_live_...", # Required
126
127
  environment="production", # Default: "production"
127
- auto_fix=True, # Enable AI-powered auto-fix
128
+ auto_fix=True, # Let Bugstack open a fix for errors this SDK reports
128
129
  debug=False, # Log SDK activity
129
130
  dry_run=False, # Log without sending
130
131
  enabled=True, # Kill switch