refresh-engine 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 (101) hide show
  1. refresh_engine-0.1.0/.github/dependabot.yml +12 -0
  2. refresh_engine-0.1.0/.github/workflows/ci.yml +49 -0
  3. refresh_engine-0.1.0/.github/workflows/release.yml +61 -0
  4. refresh_engine-0.1.0/.github/workflows/security.yml +26 -0
  5. refresh_engine-0.1.0/.gitignore +39 -0
  6. refresh_engine-0.1.0/.readthedocs.yaml +16 -0
  7. refresh_engine-0.1.0/CHANGELOG.md +33 -0
  8. refresh_engine-0.1.0/CONTRIBUTING.md +43 -0
  9. refresh_engine-0.1.0/LICENSE +201 -0
  10. refresh_engine-0.1.0/PKG-INFO +95 -0
  11. refresh_engine-0.1.0/README.md +76 -0
  12. refresh_engine-0.1.0/SECURITY.md +26 -0
  13. refresh_engine-0.1.0/benchmarks/README.md +27 -0
  14. refresh_engine-0.1.0/benchmarks/benchmark_refresh.py +166 -0
  15. refresh_engine-0.1.0/benchmarks/results/windows-python-3.12-2026-09-24.json +354 -0
  16. refresh_engine-0.1.0/docs/api/contracts.md +48 -0
  17. refresh_engine-0.1.0/docs/api/engine.md +11 -0
  18. refresh_engine-0.1.0/docs/api/index.md +16 -0
  19. refresh_engine-0.1.0/docs/api/models.md +31 -0
  20. refresh_engine-0.1.0/docs/api/services.md +32 -0
  21. refresh_engine-0.1.0/docs/api/strategies.md +24 -0
  22. refresh_engine-0.1.0/docs/architecture/decisions.md +140 -0
  23. refresh_engine-0.1.0/docs/architecture/lifecycle.md +25 -0
  24. refresh_engine-0.1.0/docs/architecture/overview.md +62 -0
  25. refresh_engine-0.1.0/docs/getting-started.md +62 -0
  26. refresh_engine-0.1.0/docs/guides/events-and-observability.md +35 -0
  27. refresh_engine-0.1.0/docs/guides/examples-and-results.md +320 -0
  28. refresh_engine-0.1.0/docs/guides/fingerprints-and-dependencies.md +30 -0
  29. refresh_engine-0.1.0/docs/guides/index.md +15 -0
  30. refresh_engine-0.1.0/docs/guides/refresh-modes.md +33 -0
  31. refresh_engine-0.1.0/docs/guides/sources-and-operations.md +38 -0
  32. refresh_engine-0.1.0/docs/guides/state-and-failure-safety.md +76 -0
  33. refresh_engine-0.1.0/docs/guides/triggers-and-scheduling.md +35 -0
  34. refresh_engine-0.1.0/docs/index.md +25 -0
  35. refresh_engine-0.1.0/examples/01_basic_and_modes.py +37 -0
  36. refresh_engine-0.1.0/examples/02_dependencies_and_fingerprints.py +30 -0
  37. refresh_engine-0.1.0/examples/03_triggers_and_selectors.py +45 -0
  38. refresh_engine-0.1.0/examples/04_async_and_external_scheduling.py +37 -0
  39. refresh_engine-0.1.0/examples/06_resilience_and_partial_discovery.py +45 -0
  40. refresh_engine-0.1.0/examples/07_events_and_observability.py +42 -0
  41. refresh_engine-0.1.0/examples/08_custom_store_and_overlap.py +47 -0
  42. refresh_engine-0.1.0/examples/09_filesystem_resources.py +76 -0
  43. refresh_engine-0.1.0/examples/10_scale_and_genericity.py +51 -0
  44. refresh_engine-0.1.0/examples/11_cancellation_and_shutdown.py +46 -0
  45. refresh_engine-0.1.0/examples/12_sqlite_state_store.py +38 -0
  46. refresh_engine-0.1.0/examples/13_abc_extensions.py +50 -0
  47. refresh_engine-0.1.0/examples/14_postgres_state_store.py +57 -0
  48. refresh_engine-0.1.0/examples/README.md +37 -0
  49. refresh_engine-0.1.0/examples/common.py +46 -0
  50. refresh_engine-0.1.0/examples/postgres_store.py +148 -0
  51. refresh_engine-0.1.0/examples/sqlite_store.py +260 -0
  52. refresh_engine-0.1.0/mkdocs.yml +59 -0
  53. refresh_engine-0.1.0/pyproject.toml +83 -0
  54. refresh_engine-0.1.0/scripts/check_docs_examples.py +18 -0
  55. refresh_engine-0.1.0/scripts/run_examples.py +22 -0
  56. refresh_engine-0.1.0/scripts/validate_distribution.py +169 -0
  57. refresh_engine-0.1.0/src/refresh_engine/__init__.py +169 -0
  58. refresh_engine-0.1.0/src/refresh_engine/api/__init__.py +43 -0
  59. refresh_engine-0.1.0/src/refresh_engine/api/abc.py +176 -0
  60. refresh_engine-0.1.0/src/refresh_engine/api/engine.py +468 -0
  61. refresh_engine-0.1.0/src/refresh_engine/api/protocols.py +89 -0
  62. refresh_engine-0.1.0/src/refresh_engine/core/models.py +362 -0
  63. refresh_engine-0.1.0/src/refresh_engine/detection/__init__.py +21 -0
  64. refresh_engine-0.1.0/src/refresh_engine/detection/detector.py +54 -0
  65. refresh_engine-0.1.0/src/refresh_engine/detection/fingerprints.py +115 -0
  66. refresh_engine-0.1.0/src/refresh_engine/errors.py +57 -0
  67. refresh_engine-0.1.0/src/refresh_engine/events/__init__.py +6 -0
  68. refresh_engine-0.1.0/src/refresh_engine/events/models.py +42 -0
  69. refresh_engine-0.1.0/src/refresh_engine/events/publisher.py +77 -0
  70. refresh_engine-0.1.0/src/refresh_engine/execution/__init__.py +5 -0
  71. refresh_engine-0.1.0/src/refresh_engine/execution/coordinator.py +128 -0
  72. refresh_engine-0.1.0/src/refresh_engine/execution/executor.py +180 -0
  73. refresh_engine-0.1.0/src/refresh_engine/observability/__init__.py +9 -0
  74. refresh_engine-0.1.0/src/refresh_engine/observability/logging.py +49 -0
  75. refresh_engine-0.1.0/src/refresh_engine/observability/metrics.py +44 -0
  76. refresh_engine-0.1.0/src/refresh_engine/planning/__init__.py +6 -0
  77. refresh_engine-0.1.0/src/refresh_engine/planning/dependency.py +79 -0
  78. refresh_engine-0.1.0/src/refresh_engine/planning/planner.py +86 -0
  79. refresh_engine-0.1.0/src/refresh_engine/py.typed +0 -0
  80. refresh_engine-0.1.0/src/refresh_engine/scheduling/__init__.py +13 -0
  81. refresh_engine-0.1.0/src/refresh_engine/scheduling/async_scheduler.py +126 -0
  82. refresh_engine-0.1.0/src/refresh_engine/scheduling/external.py +17 -0
  83. refresh_engine-0.1.0/src/refresh_engine/stores/__init__.py +11 -0
  84. refresh_engine-0.1.0/src/refresh_engine/stores/memory.py +77 -0
  85. refresh_engine-0.1.0/src/refresh_engine/triggers/__init__.py +16 -0
  86. refresh_engine-0.1.0/src/refresh_engine/triggers/adapters.py +38 -0
  87. refresh_engine-0.1.0/src/refresh_engine/triggers/selectors.py +46 -0
  88. refresh_engine-0.1.0/tests/__init__.py +1 -0
  89. refresh_engine-0.1.0/tests/concurrency/test_execution.py +134 -0
  90. refresh_engine-0.1.0/tests/conftest.py +1 -0
  91. refresh_engine-0.1.0/tests/helpers.py +77 -0
  92. refresh_engine-0.1.0/tests/integration/test_incremental.py +111 -0
  93. refresh_engine-0.1.0/tests/integration/test_safety.py +48 -0
  94. refresh_engine-0.1.0/tests/scheduler/test_scheduler.py +70 -0
  95. refresh_engine-0.1.0/tests/unit/test_abstract_bases.py +84 -0
  96. refresh_engine-0.1.0/tests/unit/test_dependency.py +55 -0
  97. refresh_engine-0.1.0/tests/unit/test_events_store_selectors.py +107 -0
  98. refresh_engine-0.1.0/tests/unit/test_fingerprints.py +91 -0
  99. refresh_engine-0.1.0/tests/unit/test_public_api.py +19 -0
  100. refresh_engine-0.1.0/tests/unit/test_triggers_models.py +49 -0
  101. refresh_engine-0.1.0/uv.lock +1138 -0
@@ -0,0 +1,12 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: uv
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ open-pull-requests-limit: 5
8
+ - package-ecosystem: github-actions
9
+ directory: /
10
+ schedule:
11
+ interval: weekly
12
+ open-pull-requests-limit: 5
@@ -0,0 +1,49 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ quality:
15
+ name: Python 3.12 / ${{ matrix.os }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ os:
20
+ - ubuntu-latest
21
+ - windows-latest
22
+ runs-on: ${{ matrix.os }}
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: astral-sh/setup-uv@v6
26
+ with:
27
+ python-version: "3.12"
28
+ enable-cache: true
29
+ - run: uv sync --frozen
30
+ - run: uv run ruff check .
31
+ - run: uv run black --check .
32
+ - run: uv run pyrefly check
33
+ - run: uv run pytest --cov=refresh_engine --cov-report=term-missing
34
+ - run: uv run python scripts/check_docs_examples.py
35
+ - run: uv run python scripts/run_examples.py
36
+ - run: uv run mkdocs build --strict
37
+
38
+ distribution:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - uses: astral-sh/setup-uv@v6
43
+ with:
44
+ python-version: "3.12"
45
+ enable-cache: true
46
+ - run: uv sync --frozen
47
+ - run: uv build
48
+ - run: uv publish --dry-run --trusted-publishing never dist/*
49
+ - run: uv run python scripts/validate_distribution.py dist
@@ -0,0 +1,61 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v[0-9]+.[0-9]+.[0-9]+"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: windows-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: astral-sh/setup-uv@v6
18
+ with:
19
+ python-version: "3.12"
20
+ enable-cache: true
21
+ - name: Synchronize environment
22
+ run: uv sync --frozen
23
+ - name: Verify release version
24
+ if: startsWith(github.ref, 'refs/tags/')
25
+ shell: pwsh
26
+ run: |
27
+ $tag = $env:GITHUB_REF_NAME.TrimStart("v")
28
+ $project = uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])"
29
+ $package = uv run python -c "import refresh_engine; print(refresh_engine.__version__)"
30
+ if ($tag -ne $project -or $tag -ne $package) {
31
+ throw "Tag ($tag), project ($project), and package ($package) versions differ"
32
+ }
33
+ - run: uv run ruff check .
34
+ - run: uv run black --check .
35
+ - run: uv run pyrefly check
36
+ - run: uv run pytest --cov
37
+ - run: uv run mkdocs build --strict
38
+ - run: uv build
39
+ - run: uv publish --dry-run --trusted-publishing never dist/*
40
+ - run: uv run python scripts/validate_distribution.py dist
41
+ - uses: actions/upload-artifact@v4
42
+ with:
43
+ name: python-distributions
44
+ path: dist/
45
+ if-no-files-found: error
46
+
47
+ publish:
48
+ if: startsWith(github.ref, 'refs/tags/')
49
+ needs: build
50
+ runs-on: ubuntu-latest
51
+ environment: pypi
52
+ permissions:
53
+ id-token: write
54
+ steps:
55
+ - uses: actions/download-artifact@v4
56
+ with:
57
+ name: python-distributions
58
+ path: dist/
59
+ - uses: astral-sh/setup-uv@v6
60
+ - name: Publish with trusted identity
61
+ run: uv publish --trusted-publishing always dist/*
@@ -0,0 +1,26 @@
1
+ name: Security
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+ schedule:
9
+ - cron: "23 5 * * 1"
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ dependency-audit:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: astral-sh/setup-uv@v6
21
+ with:
22
+ python-version: "3.12"
23
+ enable-cache: true
24
+ - run: uv sync --frozen
25
+ - run: uv export --frozen --no-dev --no-emit-project -o runtime-requirements.txt
26
+ - run: uv run pip-audit --requirement runtime-requirements.txt
@@ -0,0 +1,39 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyd
5
+ *.so
6
+ .python-version
7
+
8
+ # Environments and tools
9
+ .venv/
10
+ venv/
11
+ .coverage
12
+ .coverage.*
13
+ coverage.xml
14
+ htmlcov/
15
+ .pytest_cache/
16
+ .ruff_cache/
17
+ .hypothesis/
18
+ .mypy_cache/
19
+ .pyrefly/
20
+
21
+ # Builds and documentation
22
+ build/
23
+ dist/
24
+ site/
25
+ *.egg-info/
26
+
27
+ # Local state
28
+ *.db
29
+ *.db-shm
30
+ *.db-wal
31
+ *.sqlite
32
+ *.sqlite3
33
+ benchmark-results.json
34
+
35
+ # Editors and operating systems
36
+ .idea/
37
+ .vscode/
38
+ .DS_Store
39
+ Thumbs.db
@@ -0,0 +1,16 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-24.04
5
+ tools:
6
+ python: "3.12"
7
+
8
+ mkdocs:
9
+ configuration: mkdocs.yml
10
+
11
+ python:
12
+ install:
13
+ - method: uv
14
+ command: sync
15
+ groups:
16
+ - docs
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ All notable changes are documented here using
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) conventions. This project
5
+ uses semantic versioning.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2026-09-24
10
+
11
+ ### Added
12
+
13
+ - User, contributor, security, architecture, API, and task-oriented guide
14
+ documentation.
15
+ - Domain-neutral examples for supported integration scenarios.
16
+ - Reproducible benchmark harness for 1k, 10k, and 100k resource workloads and
17
+ multiple change profiles.
18
+ - Application-owned SQLite and PostgreSQL store examples demonstrating atomic commits,
19
+ restart continuity, rollback, and public `StateStoreABC` injection.
20
+ - Trusted Publishing release workflow.
21
+ - Optional abstract base classes for sources, fingerprints, operations, selectors,
22
+ state stores/transactions, events, metrics, and async schedulers.
23
+ - Native required `structlog` integration for structured lifecycle logging.
24
+ - NetworkX-backed dependency graph algorithms, Tenacity-backed retry policies, and
25
+ APScheduler-backed interval scheduling.
26
+ - Async-only scheduler surface; applications own any synchronous integration boundary.
27
+ - Read the Docs configuration, public-API-only reference pages, copyable examples, and
28
+ observed output.
29
+ - Cross-platform CI, dependency auditing, automated dependency updates, and clean
30
+ distribution smoke tests.
31
+ - Initial asyncio-first refresh engine with discovery, fingerprinting,
32
+ dependency-aware planning, bounded execution, transactional state, events,
33
+ triggers, and schedulers.
@@ -0,0 +1,43 @@
1
+ # Contributing
2
+
3
+ ## Setup
4
+
5
+ Use Python 3.12 and `uv`:
6
+
7
+ ```text
8
+ uv sync --frozen
9
+ ```
10
+
11
+ Runtime code lives in `src/refresh_engine`; tests live in `tests`.
12
+
13
+ ## Quality checks
14
+
15
+ Run the smallest relevant test first, then before submitting run:
16
+
17
+ ```text
18
+ uv run ruff check .
19
+ uv run black --check .
20
+ uv run pyrefly check
21
+ uv run pytest --cov=refresh_engine
22
+ uv run python scripts/check_docs_examples.py
23
+ uv run python scripts/run_examples.py
24
+ uv run mkdocs build --strict
25
+ uv build
26
+ uv publish --dry-run --trusted-publishing never dist/*
27
+ uv run python scripts/validate_distribution.py dist
28
+ ```
29
+
30
+ Environment-tagged benchmark reports in `benchmarks/results/` are accepted when the
31
+ environment and raw command are recorded. Do not include generated sites, virtual
32
+ environments, local databases, or credentials.
33
+
34
+ ## Changes
35
+
36
+ - Add tests for behavior changes and preserve deletion/state safety invariants.
37
+ - Keep public APIs domain-neutral and typed.
38
+ - Update user guides, API documentation, examples, architecture decisions, and
39
+ `CHANGELOG.md` when behavior changes.
40
+ - Keep architecture rationale in the consolidated architecture decisions document.
41
+ - Report benchmark environment and raw commands.
42
+
43
+ By contributing, you agree that your contribution is licensed under Apache-2.0.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 S. Muni Harish
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.5
2
+ Name: refresh-engine
3
+ Version: 0.1.0
4
+ Summary: Production-grade generic refresh infrastructure
5
+ Author: S. Muni Harish
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: <3.13,>=3.12
14
+ Requires-Dist: apscheduler<4,>=3.11
15
+ Requires-Dist: networkx<4,>=3.6
16
+ Requires-Dist: structlog<26,>=25.4
17
+ Requires-Dist: tenacity<10,>=9.1
18
+ Description-Content-Type: text/markdown
19
+
20
+ # refresh-engine
21
+
22
+ `refresh-engine` is an asyncio-first, domain-neutral Python library for discovering
23
+ resources, detecting changes, planning dependency-aware work, and executing
24
+ application-defined refresh operations safely.
25
+
26
+ ## Features
27
+
28
+ - full, incremental, targeted, and dependency-aware refresh modes
29
+ - deterministic fingerprints and reliable cheap pre-checks
30
+ - bounded concurrency, retries, timeouts, and overlap policies
31
+ - transactional state with an in-memory default and application-injected durable stores
32
+ - asyncio and externally managed scheduling
33
+ - typed public protocols and ABC inheritance points
34
+ - native `structlog` lifecycle logging with configurable processors and redaction
35
+
36
+ Requires Python 3.12.
37
+
38
+ `RefreshEngine` uses `InMemoryStateStore` when `store` is omitted. Applications can
39
+ inject a SQLite, PostgreSQL, or other adapter through the public `StateStore`
40
+ protocol or `StateStoreABC`:
41
+
42
+ ```python
43
+ engine = RefreshEngine(source, operation, store=my_store)
44
+ ```
45
+
46
+ SQLite and PostgreSQL reference adapters are provided under
47
+ [`examples/`](examples/README.md); database clients are not part of the production
48
+ package.
49
+
50
+ ## Quick start
51
+
52
+ ```python
53
+ import asyncio
54
+ from refresh_engine import (
55
+ DiscoveryResult, PlanAction, RefreshEngine, Resource, ResourceSnapshot,
56
+ )
57
+
58
+ class Source:
59
+ async def discover(self):
60
+ async def resources():
61
+ yield Resource("alpha")
62
+ return DiscoveryResult(resources())
63
+
64
+ async def snapshot(self, resource):
65
+ return ResourceSnapshot(resource.resource_id, content={"value": 1})
66
+
67
+ async def apply(resource, snapshot, action, request):
68
+ assert resource is not None
69
+ print(action, resource.resource_id)
70
+
71
+ async def main():
72
+ engine = RefreshEngine(Source(), apply)
73
+ result = await engine.refresh()
74
+ print(result.status, result.refreshed_count)
75
+ await engine.close()
76
+
77
+ asyncio.run(main())
78
+ ```
79
+
80
+ For a `PlanAction.DELETE`, the operation receives a lightweight `Resource` carrying
81
+ the deleted ID and `snapshot=None`; deletion handling must not expect source payloads.
82
+
83
+ ## Documentation
84
+
85
+ - [Getting started](docs/getting-started.md)
86
+ - [Guides](docs/guides/index.md)
87
+ - [API reference](docs/api/index.md)
88
+ - [Architecture](docs/architecture/overview.md)
89
+ - [Runnable examples](examples/README.md)
90
+ - [Benchmarks](benchmarks/README.md)
91
+
92
+ ## Development and support
93
+
94
+ See [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md), the
95
+ [changelog](CHANGELOG.md), and the [Apache 2.0 license](LICENSE).
@@ -0,0 +1,76 @@
1
+ # refresh-engine
2
+
3
+ `refresh-engine` is an asyncio-first, domain-neutral Python library for discovering
4
+ resources, detecting changes, planning dependency-aware work, and executing
5
+ application-defined refresh operations safely.
6
+
7
+ ## Features
8
+
9
+ - full, incremental, targeted, and dependency-aware refresh modes
10
+ - deterministic fingerprints and reliable cheap pre-checks
11
+ - bounded concurrency, retries, timeouts, and overlap policies
12
+ - transactional state with an in-memory default and application-injected durable stores
13
+ - asyncio and externally managed scheduling
14
+ - typed public protocols and ABC inheritance points
15
+ - native `structlog` lifecycle logging with configurable processors and redaction
16
+
17
+ Requires Python 3.12.
18
+
19
+ `RefreshEngine` uses `InMemoryStateStore` when `store` is omitted. Applications can
20
+ inject a SQLite, PostgreSQL, or other adapter through the public `StateStore`
21
+ protocol or `StateStoreABC`:
22
+
23
+ ```python
24
+ engine = RefreshEngine(source, operation, store=my_store)
25
+ ```
26
+
27
+ SQLite and PostgreSQL reference adapters are provided under
28
+ [`examples/`](examples/README.md); database clients are not part of the production
29
+ package.
30
+
31
+ ## Quick start
32
+
33
+ ```python
34
+ import asyncio
35
+ from refresh_engine import (
36
+ DiscoveryResult, PlanAction, RefreshEngine, Resource, ResourceSnapshot,
37
+ )
38
+
39
+ class Source:
40
+ async def discover(self):
41
+ async def resources():
42
+ yield Resource("alpha")
43
+ return DiscoveryResult(resources())
44
+
45
+ async def snapshot(self, resource):
46
+ return ResourceSnapshot(resource.resource_id, content={"value": 1})
47
+
48
+ async def apply(resource, snapshot, action, request):
49
+ assert resource is not None
50
+ print(action, resource.resource_id)
51
+
52
+ async def main():
53
+ engine = RefreshEngine(Source(), apply)
54
+ result = await engine.refresh()
55
+ print(result.status, result.refreshed_count)
56
+ await engine.close()
57
+
58
+ asyncio.run(main())
59
+ ```
60
+
61
+ For a `PlanAction.DELETE`, the operation receives a lightweight `Resource` carrying
62
+ the deleted ID and `snapshot=None`; deletion handling must not expect source payloads.
63
+
64
+ ## Documentation
65
+
66
+ - [Getting started](docs/getting-started.md)
67
+ - [Guides](docs/guides/index.md)
68
+ - [API reference](docs/api/index.md)
69
+ - [Architecture](docs/architecture/overview.md)
70
+ - [Runnable examples](examples/README.md)
71
+ - [Benchmarks](benchmarks/README.md)
72
+
73
+ ## Development and support
74
+
75
+ See [CONTRIBUTING.md](CONTRIBUTING.md), [SECURITY.md](SECURITY.md), the
76
+ [changelog](CHANGELOG.md), and the [Apache 2.0 license](LICENSE).
@@ -0,0 +1,26 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ The latest released minor version receives security fixes. Pre-release and older
6
+ minor versions may require upgrading before a fix can be applied.
7
+
8
+ ## Reporting a vulnerability
9
+
10
+ Do not open a public issue. Open the repository's **Security** tab, select
11
+ **Advisories**, and choose **Report a vulnerability** to create a private report.
12
+ Include affected versions, impact, reproduction steps, and any proposed mitigation.
13
+ Do not include production secrets or personal data. If private vulnerability
14
+ reporting is unavailable, ask the repository owner to enable it before sharing
15
+ sensitive details.
16
+
17
+ Maintainers will acknowledge a report as soon as practical, coordinate validation
18
+ and remediation privately, and disclose after a fix is available. Avoid public
19
+ disclosure until that coordination is complete.
20
+
21
+ ## Operational scope
22
+
23
+ Applications control source access, operation side effects, persistence, logging, and
24
+ secrets. Treat resource content and metadata as untrusted. Use timeouts, bounded
25
+ concurrency, least-privilege credentials, a redacting event handler, and a durable
26
+ transactional store appropriate to the deployment.