reducio 0.1.1__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 (142) hide show
  1. reducio-0.1.1/.github/workflows/analysis.yml +235 -0
  2. reducio-0.1.1/.github/workflows/installation.yml +34 -0
  3. reducio-0.1.1/.github/workflows/publish.yml +136 -0
  4. reducio-0.1.1/.github/workflows/test.yml +72 -0
  5. reducio-0.1.1/.gitignore +71 -0
  6. reducio-0.1.1/LICENSE +21 -0
  7. reducio-0.1.1/PKG-INFO +94 -0
  8. reducio-0.1.1/README.md +60 -0
  9. reducio-0.1.1/ROADMAP.md +205 -0
  10. reducio-0.1.1/docs/ADVERTISING_AUDIT.md +111 -0
  11. reducio-0.1.1/docs/ARCHITECTURE.md +123 -0
  12. reducio-0.1.1/docs/ASSESSMENT.md +319 -0
  13. reducio-0.1.1/docs/CI.md +163 -0
  14. reducio-0.1.1/docs/DESIGN.md +306 -0
  15. reducio-0.1.1/docs/GITHUB_CI.md +142 -0
  16. reducio-0.1.1/docs/LLM.md +73 -0
  17. reducio-0.1.1/docs/METRICS.md +142 -0
  18. reducio-0.1.1/docs/MIGRATION.md +80 -0
  19. reducio-0.1.1/docs/ONBOARDING.md +118 -0
  20. reducio-0.1.1/docs/README.md +253 -0
  21. reducio-0.1.1/docs/SAFETY.md +144 -0
  22. reducio-0.1.1/docs/TEST_IMPLEMENTATION.md +230 -0
  23. reducio-0.1.1/docs/TEST_RULES.md +128 -0
  24. reducio-0.1.1/docs/index.html +1186 -0
  25. reducio-0.1.1/pyproject.toml +81 -0
  26. reducio-0.1.1/reducio/__init__.py +3 -0
  27. reducio-0.1.1/reducio/__main__.py +4 -0
  28. reducio-0.1.1/reducio/agents/__init__.py +17 -0
  29. reducio-0.1.1/reducio/agents/analyzer.py +17 -0
  30. reducio-0.1.1/reducio/agents/base.py +151 -0
  31. reducio-0.1.1/reducio/agents/deduplicator.py +193 -0
  32. reducio-0.1.1/reducio/agents/idiomatizer.py +85 -0
  33. reducio-0.1.1/reducio/agents/pattern.py +225 -0
  34. reducio-0.1.1/reducio/agents/quality_checker.py +204 -0
  35. reducio-0.1.1/reducio/analysis.py +144 -0
  36. reducio-0.1.1/reducio/annotations.py +30 -0
  37. reducio-0.1.1/reducio/cli.py +741 -0
  38. reducio-0.1.1/reducio/compare.py +178 -0
  39. reducio-0.1.1/reducio/config.py +95 -0
  40. reducio-0.1.1/reducio/embeddings/__init__.py +16 -0
  41. reducio-0.1.1/reducio/embeddings/service.py +88 -0
  42. reducio-0.1.1/reducio/git_safety.py +42 -0
  43. reducio-0.1.1/reducio/history.py +229 -0
  44. reducio-0.1.1/reducio/history_report.py +114 -0
  45. reducio-0.1.1/reducio/history_view.js +117 -0
  46. reducio-0.1.1/reducio/idioms.py +422 -0
  47. reducio-0.1.1/reducio/llm/__init__.py +5 -0
  48. reducio-0.1.1/reducio/llm/router.py +118 -0
  49. reducio-0.1.1/reducio/metrics.py +218 -0
  50. reducio-0.1.1/reducio/models.py +355 -0
  51. reducio-0.1.1/reducio/parse.py +38 -0
  52. reducio-0.1.1/reducio/plan_review.py +131 -0
  53. reducio-0.1.1/reducio/presentation.py +40 -0
  54. reducio-0.1.1/reducio/progress.py +69 -0
  55. reducio-0.1.1/reducio/quality_gate.py +22 -0
  56. reducio-0.1.1/reducio/recovery.py +140 -0
  57. reducio-0.1.1/reducio/repo.py +130 -0
  58. reducio-0.1.1/reducio/reporter.py +208 -0
  59. reducio-0.1.1/reducio/runner.py +102 -0
  60. reducio-0.1.1/reducio/services.py +216 -0
  61. reducio-0.1.1/reducio/session.py +272 -0
  62. reducio-0.1.1/reducio/storage.py +64 -0
  63. reducio-0.1.1/reducio/utils/__init__.py +12 -0
  64. reducio-0.1.1/reducio/utils/code_utils.py +21 -0
  65. reducio-0.1.1/reducio/visual_report.py +515 -0
  66. reducio-0.1.1/reducio/workspace.py +159 -0
  67. reducio-0.1.1/scripts/pyapp_release.py +212 -0
  68. reducio-0.1.1/scripts/release_version.py +49 -0
  69. reducio-0.1.1/scripts/smoke_llm.py +45 -0
  70. reducio-0.1.1/scripts/smoke_pyapp.py +194 -0
  71. reducio-0.1.1/scripts/smoke_pypi.py +111 -0
  72. reducio-0.1.1/test-python-code/README.md +21 -0
  73. reducio-0.1.1/test-python-code/common_variables_name.txt +32 -0
  74. reducio-0.1.1/test-python-code/python/duplicates/auth_validator.py +58 -0
  75. reducio-0.1.1/test-python-code/python/duplicates/user_validator.py +58 -0
  76. reducio-0.1.1/test-python-code/python/duplicates/utils/validate_email_address_dedup.py +12 -0
  77. reducio-0.1.1/test-python-code/python/exercise/buildArray.py +27 -0
  78. reducio-0.1.1/test-python-code/python/exercise/variables_methods_naming_question.py +64 -0
  79. reducio-0.1.1/test-python-code/python/exercise/variables_methods_naming_solution.py +76 -0
  80. reducio-0.1.1/test-python-code/python/function/abstract_on_pizza.py +80 -0
  81. reducio-0.1.1/test-python-code/python/function/descriptif_names_function.py +36 -0
  82. reducio-0.1.1/test-python-code/python/function/high_complexity.py +160 -0
  83. reducio-0.1.1/test-python-code/python/function/long_and_repetitive_function.py +97 -0
  84. reducio-0.1.1/test-python-code/python/function/long_function.py +101 -0
  85. reducio-0.1.1/test-python-code/python/function/unintended_side_effects.py +28 -0
  86. reducio-0.1.1/test-python-code/python/patterns/complex_conditionals.py +255 -0
  87. reducio-0.1.1/test-python-code/python/style/non_idiomatic.py +158 -0
  88. reducio-0.1.1/test-python-code/python/variable/class_naming_example.py +25 -0
  89. reducio-0.1.1/test-python-code/python/variable/method_naming_example.py +17 -0
  90. reducio-0.1.1/test-python-code/python/variable/unpronounceable_variables.py +46 -0
  91. reducio-0.1.1/test-python-code/python/variable/variable_name_average.py +26 -0
  92. reducio-0.1.1/test-python-code/python/variable/variable_naming_example.py +16 -0
  93. reducio-0.1.1/tests/__init__.py +1 -0
  94. reducio-0.1.1/tests/conftest.py +63 -0
  95. reducio-0.1.1/tests/e2e/__init__.py +1 -0
  96. reducio-0.1.1/tests/e2e/test_apply_plan.py +40 -0
  97. reducio-0.1.1/tests/e2e/test_cli_smoke.py +192 -0
  98. reducio-0.1.1/tests/e2e/test_review_contracts.py +145 -0
  99. reducio-0.1.1/tests/history_view_smoke.js +72 -0
  100. reducio-0.1.1/tests/scenario/__init__.py +1 -0
  101. reducio-0.1.1/tests/scenario/test_test_rules.py +149 -0
  102. reducio-0.1.1/tests/unit/test_analysis_workflow.py +134 -0
  103. reducio-0.1.1/tests/unit/test_analyzer_hotspots.py +41 -0
  104. reducio-0.1.1/tests/unit/test_apply_guard.py +29 -0
  105. reducio-0.1.1/tests/unit/test_apply_idiomatize.py +50 -0
  106. reducio-0.1.1/tests/unit/test_cli_contracts.py +249 -0
  107. reducio-0.1.1/tests/unit/test_code_utils.py +15 -0
  108. reducio-0.1.1/tests/unit/test_compare.py +173 -0
  109. reducio-0.1.1/tests/unit/test_complexity.py +30 -0
  110. reducio-0.1.1/tests/unit/test_config.py +184 -0
  111. reducio-0.1.1/tests/unit/test_daily_workflow.py +222 -0
  112. reducio-0.1.1/tests/unit/test_deduplicator.py +56 -0
  113. reducio-0.1.1/tests/unit/test_distribution_smoke.py +93 -0
  114. reducio-0.1.1/tests/unit/test_embeddings.py +118 -0
  115. reducio-0.1.1/tests/unit/test_git.py +111 -0
  116. reducio-0.1.1/tests/unit/test_git_nonrepo.py +11 -0
  117. reducio-0.1.1/tests/unit/test_history.py +238 -0
  118. reducio-0.1.1/tests/unit/test_idiomatizer.py +186 -0
  119. reducio-0.1.1/tests/unit/test_known_safety_gaps.py +54 -0
  120. reducio-0.1.1/tests/unit/test_metrics_v2.py +119 -0
  121. reducio-0.1.1/tests/unit/test_models.py +52 -0
  122. reducio-0.1.1/tests/unit/test_new_idioms.py +83 -0
  123. reducio-0.1.1/tests/unit/test_parse.py +18 -0
  124. reducio-0.1.1/tests/unit/test_parse_regression.py +20 -0
  125. reducio-0.1.1/tests/unit/test_pattern_agent.py +121 -0
  126. reducio-0.1.1/tests/unit/test_plan_contracts.py +287 -0
  127. reducio-0.1.1/tests/unit/test_progress.py +100 -0
  128. reducio-0.1.1/tests/unit/test_pyapp_release.py +297 -0
  129. reducio-0.1.1/tests/unit/test_quality_checker.py +73 -0
  130. reducio-0.1.1/tests/unit/test_quality_gate.py +62 -0
  131. reducio-0.1.1/tests/unit/test_release_version.py +76 -0
  132. reducio-0.1.1/tests/unit/test_repo.py +19 -0
  133. reducio-0.1.1/tests/unit/test_reporter.py +104 -0
  134. reducio-0.1.1/tests/unit/test_review_gaps.py +259 -0
  135. reducio-0.1.1/tests/unit/test_router.py +218 -0
  136. reducio-0.1.1/tests/unit/test_section3_safety.py +353 -0
  137. reducio-0.1.1/tests/unit/test_session.py +89 -0
  138. reducio-0.1.1/tests/unit/test_session_metadata.py +39 -0
  139. reducio-0.1.1/tests/unit/test_site_presentation.py +139 -0
  140. reducio-0.1.1/tests/unit/test_visual_report.py +179 -0
  141. reducio-0.1.1/tests/unit/test_walk_exclusions.py +31 -0
  142. reducio-0.1.1/tests/unit/test_workspace.py +61 -0
@@ -0,0 +1,235 @@
1
+ name: Analysis
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+ inputs:
10
+ history_limit:
11
+ description: 'History commits (blank: repository REDUCIO_HISTORY_LIMIT variable, otherwise 100)'
12
+ required: false
13
+ type: string
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ overview:
20
+ if: github.event_name != 'pull_request'
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ with:
25
+ persist-credentials: false
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: '3.14'
29
+ - name: Install
30
+ run: pip install -e ".[reports]"
31
+
32
+ - name: Analyze package
33
+ run: reducio analyze reducio/ --report --format all --output-dir ci-reports/overview -v
34
+
35
+ - name: Validate structured result
36
+ run: |
37
+ python - <<'PY'
38
+ import json
39
+ from pathlib import Path
40
+ reports = list(Path("ci-reports/overview").glob("*.json"))
41
+ assert len(reports) == 1, "Expected one overview"
42
+ result = json.loads(reports[0].read_text())
43
+ assert result["complete"], "Analysis is incomplete"
44
+ assert result["total_symbols"] > 0 and result["functions"], "Parser produced no functions"
45
+ assert result["total_hotspots"] == len(result["hotspots"])
46
+ PY
47
+
48
+ - name: Quality check
49
+ run: |
50
+ reducio check reducio/ --report --output-dir ci-reports/overview
51
+
52
+ - name: Upload overview
53
+ id: reports
54
+ if: always()
55
+ uses: actions/upload-artifact@v4
56
+ with:
57
+ name: reducio-overview
58
+ path: ci-reports/overview/
59
+ if-no-files-found: warn
60
+
61
+ - name: Job summary
62
+ if: always()
63
+ env:
64
+ REPORT_URL: ${{ steps.reports.outputs.artifact-url }}
65
+ run: |
66
+ for report in ci-reports/overview/*.md; do
67
+ [ -f "$report" ] || continue
68
+ cat "$report" >> "$GITHUB_STEP_SUMMARY"
69
+ echo >> "$GITHUB_STEP_SUMMARY"
70
+ done
71
+ if [ -n "$REPORT_URL" ]; then
72
+ echo "[Download full reports — unzip and open the HTML dashboard]($REPORT_URL)" >> "$GITHUB_STEP_SUMMARY"
73
+ else
74
+ echo "Reports unavailable; inspect the failed step above." >> "$GITHUB_STEP_SUMMARY"
75
+ fi
76
+
77
+ history:
78
+ if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
79
+ runs-on: ubuntu-latest
80
+ timeout-minutes: 30
81
+ env:
82
+ REDUCIO_HISTORY_LIMIT: ${{ inputs.history_limit || vars.REDUCIO_HISTORY_LIMIT || '100' }}
83
+ steps:
84
+ - uses: actions/checkout@v4
85
+ with:
86
+ fetch-depth: 0
87
+ persist-credentials: false
88
+ - uses: actions/setup-python@v5
89
+ with:
90
+ python-version: '3.14'
91
+ - name: Install
92
+ run: pip install -e ".[reports]"
93
+ - name: Rebuild main history
94
+ run: reducio history reducio/ --ref HEAD --path-alias reducto/ --path-alias python/ai_sidecar/ --report --format all --output-dir ci-reports/history
95
+ - name: Upload history
96
+ if: always()
97
+ uses: actions/upload-artifact@v4
98
+ with:
99
+ name: reducio-history
100
+ path: ci-reports/history/
101
+ if-no-files-found: warn
102
+ - name: History summary
103
+ if: always()
104
+ run: |
105
+ for report in ci-reports/history/*.md; do
106
+ [ -f "$report" ] || continue
107
+ cat "$report" >> "$GITHUB_STEP_SUMMARY"
108
+ done
109
+
110
+ publish-pages:
111
+ needs: [overview, history]
112
+ if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
113
+ runs-on: ubuntu-latest
114
+ permissions:
115
+ contents: read
116
+ pages: write
117
+ id-token: write
118
+ environment:
119
+ name: github-pages
120
+ url: ${{ steps.deployment.outputs.page_url }}
121
+ concurrency:
122
+ group: github-pages
123
+ cancel-in-progress: false
124
+ steps:
125
+ - uses: actions/checkout@v4
126
+ with:
127
+ persist-credentials: false
128
+
129
+ - name: Download successful overview
130
+ uses: actions/download-artifact@v4
131
+ with:
132
+ name: reducio-overview
133
+ path: ci-reports/overview/
134
+
135
+ - name: Download successful history
136
+ uses: actions/download-artifact@v4
137
+ with:
138
+ name: reducio-history
139
+ path: ci-reports/history/
140
+
141
+ - name: Stage Pages site
142
+ shell: bash
143
+ run: |
144
+ shopt -s nullglob
145
+ reports=(ci-reports/overview/reducio-baseline-*.html)
146
+ if [ "${#reports[@]}" -ne 1 ]; then
147
+ echo "Expected exactly one overview dashboard" >&2
148
+ exit 1
149
+ fi
150
+ history=(ci-reports/history/reducio-history-*.html)
151
+ if [ "${#history[@]}" -ne 1 ]; then
152
+ echo "Expected exactly one history dashboard" >&2
153
+ exit 1
154
+ fi
155
+ mkdir -p ci-reports/pages/dashboard
156
+ cp docs/index.html ci-reports/pages/index.html
157
+ cp "${reports[0]}" ci-reports/pages/dashboard/overview.html
158
+ cp "${history[0]}" ci-reports/pages/dashboard/index.html
159
+
160
+ - name: Configure Pages
161
+ uses: actions/configure-pages@v5
162
+
163
+ - name: Upload Pages site
164
+ uses: actions/upload-pages-artifact@v4
165
+ with:
166
+ path: ci-reports/pages/
167
+
168
+ - name: Deploy Pages
169
+ id: deployment
170
+ uses: actions/deploy-pages@v4
171
+
172
+ - name: Dashboard link
173
+ env:
174
+ PAGE_URL: ${{ steps.deployment.outputs.page_url }}
175
+ run: |
176
+ echo "[Open the main-branch dashboard](${PAGE_URL%/}/dashboard/)" >> "$GITHUB_STEP_SUMMARY"
177
+ echo "[Open the latest standalone overview](${PAGE_URL%/}/dashboard/overview.html)" >> "$GITHUB_STEP_SUMMARY"
178
+
179
+ comparison:
180
+ if: github.event_name == 'pull_request'
181
+ runs-on: ubuntu-latest
182
+ steps:
183
+ - uses: actions/checkout@v4
184
+ with:
185
+ ref: ${{ github.event.pull_request.head.sha }}
186
+ fetch-depth: 0
187
+ persist-credentials: false
188
+ - uses: actions/setup-python@v5
189
+ with:
190
+ python-version: '3.14'
191
+ - name: Install
192
+ run: pip install -e ".[reports]"
193
+
194
+ - name: Resolve PR comparison
195
+ id: revisions
196
+ env:
197
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
198
+ HEAD_SHA: ${{ github.event.pull_request.head.sha }}
199
+ run: |
200
+ MERGE_BASE=$(git merge-base "$BASE_SHA" "$HEAD_SHA")
201
+ echo "base=$MERGE_BASE" >> "$GITHUB_OUTPUT"
202
+
203
+ - name: Compare changed package files
204
+ env:
205
+ BASE_SHA: ${{ steps.revisions.outputs.base }}
206
+ HEAD_SHA: ${{ github.event.pull_request.head.sha }}
207
+ REDUCIO_COMPARE_FAIL_ON: ${{ vars.REDUCIO_COMPARE_FAIL_ON || 'none' }}
208
+ run: |
209
+ reducio compare reducio/ --base "$BASE_SHA" --head "$HEAD_SHA" \
210
+ --annotations github --report --format all --output-dir ci-reports/comparison -v
211
+
212
+ - name: Upload comparison
213
+ id: reports
214
+ if: always()
215
+ uses: actions/upload-artifact@v4
216
+ with:
217
+ name: reducio-comparison
218
+ path: ci-reports/comparison/
219
+ if-no-files-found: warn
220
+
221
+ - name: Job summary
222
+ if: always()
223
+ env:
224
+ REPORT_URL: ${{ steps.reports.outputs.artifact-url }}
225
+ run: |
226
+ for report in ci-reports/comparison/*.md; do
227
+ [ -f "$report" ] || continue
228
+ cat "$report" >> "$GITHUB_STEP_SUMMARY"
229
+ echo >> "$GITHUB_STEP_SUMMARY"
230
+ done
231
+ if [ -n "$REPORT_URL" ]; then
232
+ echo "[Download full reports — unzip and open the HTML dashboard]($REPORT_URL)" >> "$GITHUB_STEP_SUMMARY"
233
+ else
234
+ echo "Comparison unavailable; inspect the failed step above." >> "$GITHUB_STEP_SUMMARY"
235
+ fi
@@ -0,0 +1,34 @@
1
+ name: Installation
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ install:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: actions/setup-python@v5
15
+ with:
16
+ python-version: '3.14'
17
+ - run: pip install -e ".[embeddings]"
18
+ - run: reducio version
19
+ - run: python -c "import reducio; print(reducio.__version__)"
20
+
21
+ wheel:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: '3.14'
28
+ - run: pip install build && python -m build
29
+ - run: pip install dist/*.whl && reducio --help
30
+ - name: Base installation needs no HTTP client
31
+ run: python -I -c "import reducio.cli, importlib.util; assert all(importlib.util.find_spec(name) is None for name in ('httpx', 'tree_sitter', 'chromadb', 'numpy'))"
32
+ - run: pip install 'reducio[llm]'
33
+ - name: Optional API contracts (no live API calls)
34
+ run: python -I scripts/smoke_llm.py
@@ -0,0 +1,136 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags: ['v*']
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ concurrency:
11
+ group: publish-${{ github.ref }}
12
+ cancel-in-progress: false
13
+
14
+ jobs:
15
+ verify:
16
+ uses: ./.github/workflows/test.yml
17
+ with:
18
+ release_tag: ${{ github.ref_name }}
19
+
20
+ pypi:
21
+ needs: verify
22
+ runs-on: ubuntu-latest
23
+ permissions:
24
+ contents: read
25
+ id-token: write
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ - uses: actions/setup-python@v5
29
+ with:
30
+ python-version: '3.14'
31
+ - name: Download verified distributions (do not rebuild)
32
+ uses: actions/download-artifact@v4
33
+ with:
34
+ name: dist
35
+ path: dist/
36
+ - name: Save the wheel being published
37
+ uses: actions/upload-artifact@v4
38
+ with:
39
+ name: published-wheel-${{ github.run_attempt }}
40
+ path: dist/*.whl
41
+ if-no-files-found: error
42
+ - uses: pypa/gh-action-pypi-publish@release/v1
43
+
44
+ verify-pypi:
45
+ needs: pypi
46
+ runs-on: ubuntu-22.04
47
+ timeout-minutes: 30
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ with:
51
+ ref: ${{ github.sha }}
52
+ persist-credentials: false
53
+ - uses: actions/setup-python@v5
54
+ with:
55
+ python-version: '3.14'
56
+ - run: python -m pip install packaging
57
+ - uses: actions/download-artifact@v4
58
+ with:
59
+ pattern: published-wheel-*
60
+ path: wheels
61
+ - name: Verify the published wheel in isolation
62
+ run: python -m scripts.smoke_pypi --wheel-directory wheels --commit "$(git rev-parse HEAD)"
63
+
64
+ pyapp:
65
+ needs: [pypi, verify-pypi]
66
+ runs-on: ubuntu-22.04
67
+ timeout-minutes: 45
68
+ permissions:
69
+ contents: write
70
+ steps:
71
+ - uses: actions/checkout@v4
72
+ with:
73
+ ref: ${{ github.sha }}
74
+ persist-credentials: false
75
+ - uses: actions/setup-python@v5
76
+ with:
77
+ python-version: '3.14'
78
+ - run: python -m pip install packaging
79
+ # A failed-job rerun keeps the successful PyPI job's original artifact.
80
+ - uses: actions/download-artifact@v4
81
+ with:
82
+ pattern: published-wheel-*
83
+ path: wheels
84
+ - name: Identify the published package and commit
85
+ id: package
86
+ env:
87
+ RELEASE_TAG: ${{ github.ref_name }}
88
+ run: |
89
+ python scripts/pyapp_release.py metadata \
90
+ --wheel-directory wheels --commit "$(git rev-parse HEAD)" \
91
+ --tag "$RELEASE_TAG" --output "$GITHUB_OUTPUT"
92
+ - name: Set up Rust stable
93
+ run: |
94
+ rustup toolchain install stable --profile minimal
95
+ rustup default stable
96
+ - name: Build PyApp executable
97
+ env:
98
+ PYAPP_PROJECT_PATH: ${{ steps.package.outputs.wheel }}
99
+ PYAPP_EXEC_SPEC: reducio.cli:app
100
+ PYAPP_PYTHON_VERSION: '3.14'
101
+ PYAPP_DISTRIBUTION_VARIANT_CPU: v1
102
+ PYAPP_PROJECT_FEATURES: reports,embeddings,llm
103
+ PYAPP_SELF_COMMAND: none
104
+ PYAPP_VERSION: '0.29.0'
105
+ BINARY_NAME: ${{ steps.package.outputs.binary_name }}
106
+ run: |
107
+ curl --fail --silent --show-error --location \
108
+ "https://github.com/ofek/pyapp/releases/download/v${PYAPP_VERSION}/source.tar.gz" \
109
+ --output "$RUNNER_TEMP/pyapp-source.tar.gz"
110
+ mkdir -p "$RUNNER_TEMP/pyapp-source"
111
+ tar -xzf "$RUNNER_TEMP/pyapp-source.tar.gz" \
112
+ --directory "$RUNNER_TEMP/pyapp-source" --strip-components=1
113
+ cargo build --release --locked \
114
+ --manifest-path "$RUNNER_TEMP/pyapp-source/Cargo.toml" \
115
+ --target x86_64-unknown-linux-gnu
116
+ mkdir -p executable
117
+ install -m 755 \
118
+ "$RUNNER_TEMP/pyapp-source/target/x86_64-unknown-linux-gnu/release/pyapp" \
119
+ "executable/$BINARY_NAME"
120
+ - name: Smoke-test the executable and optional features
121
+ env:
122
+ BINARY_NAME: ${{ steps.package.outputs.binary_name }}
123
+ PACKAGE_VERSION: ${{ steps.package.outputs.version }}
124
+ run: |
125
+ python scripts/smoke_pyapp.py \
126
+ "executable/$BINARY_NAME" "$PACKAGE_VERSION"
127
+ - name: Publish executable to GitHub Releases
128
+ env:
129
+ GH_TOKEN: ${{ github.token }}
130
+ RELEASE_TAG: ${{ github.ref_name }}
131
+ RELEASE_COMMIT: ${{ steps.package.outputs.commit }}
132
+ run: |
133
+ python scripts/pyapp_release.py publish \
134
+ --wheel-directory wheels --commit "$RELEASE_COMMIT" \
135
+ --tag "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" \
136
+ --asset-directory executable --summary "$GITHUB_STEP_SUMMARY"
@@ -0,0 +1,72 @@
1
+ name: CI
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ release_tag:
7
+ type: string
8
+ default: ''
9
+ push:
10
+ branches: [main, develop]
11
+ pull_request:
12
+ branches: [main]
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: '3.14'
24
+
25
+ - name: Install
26
+ run: pip install -e ".[dev,embeddings,reports,llm]"
27
+
28
+ - name: Tests
29
+ run: pytest tests/ -v
30
+
31
+ - name: Assert fixture corpus unmodified
32
+ if: always()
33
+ run: git diff --exit-code test-python-code/
34
+
35
+ - name: CLI smoke
36
+ run: reducio --help && reducio version
37
+
38
+ lint:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - uses: actions/setup-python@v5
43
+ with:
44
+ python-version: '3.14'
45
+ - run: pip install -e ".[dev]"
46
+ - run: ruff check reducio/ tests/ scripts/
47
+ - run: black --check reducio/ tests/ scripts/
48
+ - run: mypy reducio/ --ignore-missing-imports
49
+
50
+ build:
51
+ runs-on: ubuntu-latest
52
+ needs: [test, lint]
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ - uses: actions/setup-python@v5
56
+ with:
57
+ python-version: '3.14'
58
+ - run: python -m pip install build packaging
59
+ - name: Set package version from release tag
60
+ if: inputs.release_tag != ''
61
+ env:
62
+ RELEASE_TAG: ${{ inputs.release_tag }}
63
+ run: python scripts/release_version.py "$RELEASE_TAG"
64
+ - run: python -m build
65
+ - name: Verify built wheel before publication (no model downloads)
66
+ run: python -m scripts.smoke_pypi --local --wheel-directory dist --commit "$(git rev-parse HEAD)"
67
+ - uses: actions/upload-artifact@v4
68
+ with:
69
+ name: dist
70
+ path: dist/
71
+ overwrite: true
72
+ if-no-files-found: error
@@ -0,0 +1,71 @@
1
+ # If you prefer the allow list template instead of the deny list, see community template:
2
+ # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3
+ #
4
+ # Binaries for programs and plugins
5
+ *.exe
6
+ *.exe~
7
+ *.dll
8
+ *.so
9
+ *.dylib
10
+ /reducio$
11
+ !/reducio/
12
+
13
+ # Test binary, built with `go test -c`
14
+ *.test
15
+
16
+ # Code coverage profiles and other test artifacts
17
+ *.out
18
+ .coverage
19
+ coverage.*
20
+ *.coverprofile
21
+ profile.cov
22
+
23
+ # Dependency directories (remove the comment below to include it)
24
+ # vendor/
25
+
26
+ # Go workspace file
27
+ go.work
28
+ go.work.sum
29
+
30
+ # env file
31
+ .env
32
+
33
+ # Editor/IDE
34
+ # .idea/
35
+ # .vscode/
36
+
37
+ # Python
38
+ __pycache__/
39
+ *.py[cod]
40
+ *$py.class
41
+ *.so
42
+ .Python
43
+ build/
44
+ develop-eggs/
45
+ dist/
46
+ downloads/
47
+ eggs/
48
+ .eggs/
49
+ lib/
50
+ lib64/
51
+ parts/
52
+ sdist/
53
+ var/
54
+ wheels/
55
+ *.egg-info/
56
+ .installed.cfg
57
+ *.egg
58
+ .venv/
59
+ venv/
60
+ ENV/
61
+ .pytest_cache/
62
+ .mypy_cache/
63
+ .ruff_cache/
64
+
65
+
66
+ AGENTS.md
67
+ .reducio*
68
+ .reducio/
69
+ # Preserve ignored reports/configuration from before the rename.
70
+ .reducto*
71
+ ci-reports/
reducio-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alex Karsten
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.
reducio-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.5
2
+ Name: reducio
3
+ Version: 0.1.1
4
+ Summary: Semantic code compression engine
5
+ Project-URL: Repository, https://github.com/mementomorri/reducio
6
+ Project-URL: Documentation, https://github.com/mementomorri/reducio/blob/main/docs/README.md
7
+ Author: Alex Karsten
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.14
12
+ Requires-Python: >=3.14
13
+ Requires-Dist: gitpython>=3.1.0
14
+ Requires-Dist: pydantic>=2.0.0
15
+ Requires-Dist: pyyaml>=6.0
16
+ Requires-Dist: typer>=0.12.0
17
+ Provides-Extra: dev
18
+ Requires-Dist: black>=23.0.0; extra == 'dev'
19
+ Requires-Dist: coverage[toml]>=7.10.6; extra == 'dev'
20
+ Requires-Dist: hatchling; extra == 'dev'
21
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
22
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
23
+ Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
24
+ Requires-Dist: pytest>=7.4.0; extra == 'dev'
25
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
26
+ Provides-Extra: embeddings
27
+ Requires-Dist: numpy>=1.26; extra == 'embeddings'
28
+ Requires-Dist: sentence-transformers>=2.2.0; extra == 'embeddings'
29
+ Provides-Extra: llm
30
+ Requires-Dist: httpx<1,>=0.28; extra == 'llm'
31
+ Provides-Extra: reports
32
+ Requires-Dist: plotly<8,>=6; extra == 'reports'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # reducio
36
+
37
+ Optional model proposals: [API setup and migration](docs/LLM.md).
38
+
39
+ **Semantic code compression for Python codebases.**
40
+
41
+ Install, usage, and architecture: **[docs/README.md](docs/README.md)**
42
+ What's shipped vs planned: **[ROADMAP.md](ROADMAP.md)**
43
+
44
+ Start with the [GitHub CI setup guide](docs/GITHUB_CI.md) for reports and revision
45
+ comparisons. The other supported routes are PyPI and a GitHub Releases executable;
46
+ the distribution, CLI, and Python import are all **`reducio`**.
47
+ PyPI publication is configured and the maintainer has confirmed a successful upload.
48
+ Counting rules: [Metrics v2](docs/METRICS.md).
49
+ Upgrading after the reliability cleanup: [migration notes](docs/MIGRATION.md).
50
+ Application uses file snapshots and never commits changes. Tests are opt-in with
51
+ `--run-tests`; see [safety and runner setup](docs/SAFETY.md).
52
+
53
+ Requires **Python 3.14+**. Only **`.py`** files in the target repository are analyzed.
54
+
55
+ ## Everyday workflow
56
+
57
+ reducio helps reviewers see where Python changes add or reduce complexity.
58
+ Use it primarily for **read-only code review**, with optional, manually reviewed
59
+ refactoring proposals—not as proof that code is correct.
60
+
61
+ 1. **While coding:** run `reducio check .` for quality findings or
62
+ `reducio analyze .` for complexity hotspots in current files.
63
+ 2. **On a PR:** compare the branch's common ancestor with `main` against the PR
64
+ head. This covers the whole PR, not just its last commit, measuring complete
65
+ functions in changed Python files. Review the Actions summary or HTML artifact.
66
+ 3. **After merging:** rebuild history on `main` to explore size, complexity trends
67
+ and persistent hotspots. This repo publishes history to GitHub Pages and keeps
68
+ the latest overview alongside it. PR reports stay in Actions artifacts.
69
+
70
+ To review your committed branch locally (`reducio[reports]` adds HTML charts):
71
+
72
+ ```bash
73
+ git fetch origin main
74
+ reducio compare . --against origin/main --report --format all
75
+ # Include your current edits and nonignored untracked Python files:
76
+ reducio compare . --against origin/main --worktree --report --format all
77
+ # Explore up to 100 first-parent commits, rebuilt with today's metric engine:
78
+ reducio history . --report --format all
79
+ ```
80
+
81
+ Use `--base HEAD~1` instead to inspect only the last commit, or `--base HEAD
82
+ --worktree` for uncommitted work only. reducio never fetches refs automatically.
83
+ Comparison ignores uncommitted edits unless `--worktree` is explicit. Add
84
+ `--fail-on new-hotspots` or `--fail-on regressions` to enforce an optional PR gate;
85
+ otherwise complexity increases remain informational.
86
+ Reports default to `.reducio/`; open the HTML directly in a browser, without a server.
87
+
88
+ Start with the [CI setup guide](docs/GITHUB_CI.md). For optional code changes,
89
+ preview with `reducio idiomatize . --dry-run` and review before applying with
90
+ `--run-tests`. Deduplication remains suggestion-only; it does not rewrite callers.
91
+
92
+ ## License
93
+
94
+ [MIT](LICENSE) © 2026 Alex Karsten