buttress 0.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 (177) hide show
  1. buttress-0.2.0/LICENSE +21 -0
  2. buttress-0.2.0/PKG-INFO +268 -0
  3. buttress-0.2.0/README.md +219 -0
  4. buttress-0.2.0/pyproject.toml +121 -0
  5. buttress-0.2.0/setup.cfg +4 -0
  6. buttress-0.2.0/src/buttress/__init__.py +63 -0
  7. buttress-0.2.0/src/buttress/__main__.py +7 -0
  8. buttress-0.2.0/src/buttress/analysis/__init__.py +44 -0
  9. buttress-0.2.0/src/buttress/analysis/discovery.py +176 -0
  10. buttress-0.2.0/src/buttress/analysis/external.py +92 -0
  11. buttress-0.2.0/src/buttress/analysis/extractor.py +329 -0
  12. buttress-0.2.0/src/buttress/analysis/interfaces.py +49 -0
  13. buttress-0.2.0/src/buttress/analysis/manifest_parser.py +337 -0
  14. buttress-0.2.0/src/buttress/analysis/resolver.py +143 -0
  15. buttress-0.2.0/src/buttress/analysis/scanner.py +179 -0
  16. buttress-0.2.0/src/buttress/analysis/stdlib.py +60 -0
  17. buttress-0.2.0/src/buttress/api/__init__.py +129 -0
  18. buttress-0.2.0/src/buttress/api/analysis.py +51 -0
  19. buttress-0.2.0/src/buttress/api/baselines.py +29 -0
  20. buttress-0.2.0/src/buttress/api/contracts.py +85 -0
  21. buttress-0.2.0/src/buttress/api/project.py +881 -0
  22. buttress-0.2.0/src/buttress/api/synchronization.py +40 -0
  23. buttress-0.2.0/src/buttress/application/__init__.py +24 -0
  24. buttress-0.2.0/src/buttress/application/analysis_service.py +209 -0
  25. buttress-0.2.0/src/buttress/application/baseline_service.py +62 -0
  26. buttress-0.2.0/src/buttress/application/context.py +45 -0
  27. buttress-0.2.0/src/buttress/application/contract_service.py +236 -0
  28. buttress-0.2.0/src/buttress/application/report_service.py +164 -0
  29. buttress-0.2.0/src/buttress/application/sync_service.py +100 -0
  30. buttress-0.2.0/src/buttress/application/test_impact_service.py +219 -0
  31. buttress-0.2.0/src/buttress/cli/__init__.py +6 -0
  32. buttress-0.2.0/src/buttress/cli/commands/__init__.py +2 -0
  33. buttress-0.2.0/src/buttress/cli/commands/architecture_cmd.py +231 -0
  34. buttress-0.2.0/src/buttress/cli/commands/baseline_cmd.py +157 -0
  35. buttress-0.2.0/src/buttress/cli/commands/cache_cmd.py +120 -0
  36. buttress-0.2.0/src/buttress/cli/commands/check_cmd.py +232 -0
  37. buttress-0.2.0/src/buttress/cli/commands/check_external_cmd.py +197 -0
  38. buttress-0.2.0/src/buttress/cli/commands/config_cmd.py +153 -0
  39. buttress-0.2.0/src/buttress/cli/commands/configure_cmd.py +297 -0
  40. buttress-0.2.0/src/buttress/cli/commands/contracts_cmd.py +205 -0
  41. buttress-0.2.0/src/buttress/cli/commands/deadcode_cmd.py +166 -0
  42. buttress-0.2.0/src/buttress/cli/commands/doctor_cmd.py +105 -0
  43. buttress-0.2.0/src/buttress/cli/commands/explain_cmd.py +116 -0
  44. buttress-0.2.0/src/buttress/cli/commands/fix_cmd.py +320 -0
  45. buttress-0.2.0/src/buttress/cli/commands/graph_cmd.py +64 -0
  46. buttress-0.2.0/src/buttress/cli/commands/init_cmd.py +143 -0
  47. buttress-0.2.0/src/buttress/cli/commands/install_cmd.py +42 -0
  48. buttress-0.2.0/src/buttress/cli/commands/map_cmd.py +67 -0
  49. buttress-0.2.0/src/buttress/cli/commands/mod_cmd.py +266 -0
  50. buttress-0.2.0/src/buttress/cli/commands/report_cmd.py +148 -0
  51. buttress-0.2.0/src/buttress/cli/commands/scan_cmd.py +183 -0
  52. buttress-0.2.0/src/buttress/cli/commands/show_cmd.py +65 -0
  53. buttress-0.2.0/src/buttress/cli/commands/sync_cmd.py +200 -0
  54. buttress-0.2.0/src/buttress/cli/commands/test_cmd.py +130 -0
  55. buttress-0.2.0/src/buttress/cli/entrypoint.py +316 -0
  56. buttress-0.2.0/src/buttress/cli/formatters/__init__.py +2 -0
  57. buttress-0.2.0/src/buttress/cli/formatters/console.py +64 -0
  58. buttress-0.2.0/src/buttress/configuration/__init__.py +67 -0
  59. buttress-0.2.0/src/buttress/configuration/discovery.py +158 -0
  60. buttress-0.2.0/src/buttress/configuration/domain.py +153 -0
  61. buttress-0.2.0/src/buttress/configuration/loader.py +225 -0
  62. buttress-0.2.0/src/buttress/configuration/migration.py +159 -0
  63. buttress-0.2.0/src/buttress/configuration/models.py +361 -0
  64. buttress-0.2.0/src/buttress/configuration/precedence.py +93 -0
  65. buttress-0.2.0/src/buttress/configuration/schema.py +25 -0
  66. buttress-0.2.0/src/buttress/configuration/validator.py +263 -0
  67. buttress-0.2.0/src/buttress/configuration/writer.py +236 -0
  68. buttress-0.2.0/src/buttress/contracts/__init__.py +41 -0
  69. buttress-0.2.0/src/buttress/contracts/acyclic_siblings.py +187 -0
  70. buttress-0.2.0/src/buttress/contracts/analyzer.py +225 -0
  71. buttress-0.2.0/src/buttress/contracts/base.py +236 -0
  72. buttress-0.2.0/src/buttress/contracts/declarative.py +701 -0
  73. buttress-0.2.0/src/buttress/contracts/forbidden.py +155 -0
  74. buttress-0.2.0/src/buttress/contracts/independence.py +126 -0
  75. buttress-0.2.0/src/buttress/contracts/layers.py +505 -0
  76. buttress-0.2.0/src/buttress/contracts/module_policy.py +313 -0
  77. buttress-0.2.0/src/buttress/contracts/protected.py +126 -0
  78. buttress-0.2.0/src/buttress/contracts/public_interface.py +128 -0
  79. buttress-0.2.0/src/buttress/contracts/registry.py +452 -0
  80. buttress-0.2.0/src/buttress/domain/__init__.py +137 -0
  81. buttress-0.2.0/src/buttress/domain/baseline.py +146 -0
  82. buttress-0.2.0/src/buttress/domain/contract.py +122 -0
  83. buttress-0.2.0/src/buttress/domain/exceptions.py +637 -0
  84. buttress-0.2.0/src/buttress/domain/finding.py +118 -0
  85. buttress-0.2.0/src/buttress/domain/graph.py +607 -0
  86. buttress-0.2.0/src/buttress/domain/import_statement.py +67 -0
  87. buttress-0.2.0/src/buttress/domain/module.py +230 -0
  88. buttress-0.2.0/src/buttress/domain/policy.py +131 -0
  89. buttress-0.2.0/src/buttress/domain/suppression.py +128 -0
  90. buttress-0.2.0/src/buttress/infrastructure/cache/__init__.py +12 -0
  91. buttress-0.2.0/src/buttress/infrastructure/cache/manager.py +146 -0
  92. buttress-0.2.0/src/buttress/infrastructure/cache/models.py +99 -0
  93. buttress-0.2.0/src/buttress/infrastructure/cache/sqlite_store.py +340 -0
  94. buttress-0.2.0/src/buttress/infrastructure/exporters/__init__.py +18 -0
  95. buttress-0.2.0/src/buttress/infrastructure/exporters/dot.py +49 -0
  96. buttress-0.2.0/src/buttress/infrastructure/exporters/json_export.py +39 -0
  97. buttress-0.2.0/src/buttress/infrastructure/exporters/mermaid.py +49 -0
  98. buttress-0.2.0/src/buttress/infrastructure/exporters/sarif.py +115 -0
  99. buttress-0.2.0/src/buttress/infrastructure/grimp_adapter.py +80 -0
  100. buttress-0.2.0/src/buttress/infrastructure/vcs/__init__.py +6 -0
  101. buttress-0.2.0/src/buttress/infrastructure/vcs/git_adapter.py +115 -0
  102. buttress-0.2.0/src/buttress/integrations/__init__.py +20 -0
  103. buttress-0.2.0/src/buttress/integrations/github_actions.py +74 -0
  104. buttress-0.2.0/src/buttress/integrations/pre_commit.py +91 -0
  105. buttress-0.2.0/src/buttress/integrations/pytest_plugin.py +74 -0
  106. buttress-0.2.0/src/buttress/plugins/__init__.py +13 -0
  107. buttress-0.2.0/src/buttress/plugins/loader.py +339 -0
  108. buttress-0.2.0/src/buttress/plugins/manager.py +136 -0
  109. buttress-0.2.0/src/buttress/py.typed +1 -0
  110. buttress-0.2.0/src/buttress/remediation/__init__.py +32 -0
  111. buttress-0.2.0/src/buttress/remediation/conflicts.py +113 -0
  112. buttress-0.2.0/src/buttress/remediation/diff.py +63 -0
  113. buttress-0.2.0/src/buttress/remediation/models.py +307 -0
  114. buttress-0.2.0/src/buttress/remediation/rules/__init__.py +7 -0
  115. buttress-0.2.0/src/buttress/remediation/rules/ast_utils.py +214 -0
  116. buttress-0.2.0/src/buttress/remediation/rules/base.py +58 -0
  117. buttress-0.2.0/src/buttress/remediation/rules/builtin/__init__.py +23 -0
  118. buttress-0.2.0/src/buttress/remediation/rules/builtin/lazy_import_wrapper.py +378 -0
  119. buttress-0.2.0/src/buttress/remediation/rules/builtin/module_policy_deprecation.py +129 -0
  120. buttress-0.2.0/src/buttress/remediation/rules/builtin/remove_stale_ignore_comment.py +100 -0
  121. buttress-0.2.0/src/buttress/remediation/rules/builtin/remove_unused_forbidden_import.py +159 -0
  122. buttress-0.2.0/src/buttress/remediation/rules/builtin/replace_with_public_facade.py +173 -0
  123. buttress-0.2.0/src/buttress/remediation/rules/builtin/type_checking_guard.py +192 -0
  124. buttress-0.2.0/src/buttress/remediation/rules/custom.py +210 -0
  125. buttress-0.2.0/src/buttress/remediation/rules/registry.py +100 -0
  126. buttress-0.2.0/src/buttress/remediation/service.py +259 -0
  127. buttress-0.2.0/src/buttress/remediation/transaction.py +348 -0
  128. buttress-0.2.0/src/buttress/remediation/transformer.py +983 -0
  129. buttress-0.2.0/src/buttress/remediation/verifier.py +118 -0
  130. buttress-0.2.0/src/buttress/server/__init__.py +11 -0
  131. buttress-0.2.0/src/buttress/server/api/__init__.py +6 -0
  132. buttress-0.2.0/src/buttress/server/api/handlers.py +879 -0
  133. buttress-0.2.0/src/buttress/server/api/metadata.py +395 -0
  134. buttress-0.2.0/src/buttress/server/router.py +186 -0
  135. buttress-0.2.0/src/buttress/server/security.py +91 -0
  136. buttress-0.2.0/src/buttress/server/server.py +304 -0
  137. buttress-0.2.0/src/buttress/server/static/css/components.css +862 -0
  138. buttress-0.2.0/src/buttress/server/static/css/diff.css +119 -0
  139. buttress-0.2.0/src/buttress/server/static/css/graph.css +256 -0
  140. buttress-0.2.0/src/buttress/server/static/css/layout.css +570 -0
  141. buttress-0.2.0/src/buttress/server/static/css/reset.css +76 -0
  142. buttress-0.2.0/src/buttress/server/static/css/tokens.css +67 -0
  143. buttress-0.2.0/src/buttress/server/static/img/logo.png +0 -0
  144. buttress-0.2.0/src/buttress/server/static/index.html +191 -0
  145. buttress-0.2.0/src/buttress/server/static/js/app.js +345 -0
  146. buttress-0.2.0/src/buttress/server/static/js/components/diff_viewer.js +100 -0
  147. buttress-0.2.0/src/buttress/server/static/js/core/api.js +119 -0
  148. buttress-0.2.0/src/buttress/server/static/js/core/dom.js +152 -0
  149. buttress-0.2.0/src/buttress/server/static/js/core/state.js +103 -0
  150. buttress-0.2.0/src/buttress/server/static/js/graph/canvas.js +189 -0
  151. buttress-0.2.0/src/buttress/server/static/js/graph/layout.js +224 -0
  152. buttress-0.2.0/src/buttress/server/static/js/graph/renderer.js +76 -0
  153. buttress-0.2.0/src/buttress/server/static/js/graph/table_fallback.js +65 -0
  154. buttress-0.2.0/src/buttress/server/static/js/icons.js +29 -0
  155. buttress-0.2.0/src/buttress/server/static/js/views/about_panel.js +73 -0
  156. buttress-0.2.0/src/buttress/server/static/js/views/architecture.js +240 -0
  157. buttress-0.2.0/src/buttress/server/static/js/views/baselines.js +226 -0
  158. buttress-0.2.0/src/buttress/server/static/js/views/contracts.js +643 -0
  159. buttress-0.2.0/src/buttress/server/static/js/views/dependencies.js +324 -0
  160. buttress-0.2.0/src/buttress/server/static/js/views/help_panel.js +397 -0
  161. buttress-0.2.0/src/buttress/server/static/js/views/impact.js +149 -0
  162. buttress-0.2.0/src/buttress/server/static/js/views/inspector.js +213 -0
  163. buttress-0.2.0/src/buttress/server/static/js/views/overview.js +344 -0
  164. buttress-0.2.0/src/buttress/server/static/js/views/remediation.js +398 -0
  165. buttress-0.2.0/src/buttress/server/static/js/views/reports.js +113 -0
  166. buttress-0.2.0/src/buttress/server/static/js/views/settings.js +511 -0
  167. buttress-0.2.0/src/buttress/server/static/js/views/violations.js +278 -0
  168. buttress-0.2.0/src/buttress/utils/__init__.py +2 -0
  169. buttress-0.2.0/src/buttress/utils/atomic_write.py +262 -0
  170. buttress-0.2.0/src/buttress/utils/path_utils.py +120 -0
  171. buttress-0.2.0/src/buttress/version.py +5 -0
  172. buttress-0.2.0/src/buttress.egg-info/PKG-INFO +268 -0
  173. buttress-0.2.0/src/buttress.egg-info/SOURCES.txt +175 -0
  174. buttress-0.2.0/src/buttress.egg-info/dependency_links.txt +1 -0
  175. buttress-0.2.0/src/buttress.egg-info/entry_points.txt +5 -0
  176. buttress-0.2.0/src/buttress.egg-info/requires.txt +27 -0
  177. buttress-0.2.0/src/buttress.egg-info/top_level.txt +1 -0
buttress-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Viraj Ravani
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.
@@ -0,0 +1,268 @@
1
+ Metadata-Version: 2.4
2
+ Name: buttress
3
+ Version: 0.2.0
4
+ Summary: Python architecture governance, dependency graph analysis, and LibCST auto-remediation.
5
+ Author-email: viraj ravani <ravaniviraj@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/v3ravani/buttress
8
+ Project-URL: Repository, https://github.com/v3ravani/buttress
9
+ Project-URL: Issues, https://github.com/v3ravani/buttress/issues
10
+ Project-URL: Changelog, https://github.com/v3ravani/buttress/blob/main/CHANGELOG.md
11
+ Keywords: architecture,dependency-analysis,import-linter,tach,static-analysis,layer-architecture,linter
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Classifier: Topic :: Software Development :: Testing
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: click>=8.1.0
27
+ Requires-Dist: rich>=13.0.0
28
+ Requires-Dist: pydantic>=2.5.0
29
+ Requires-Dist: grimp>=3.2.0
30
+ Requires-Dist: libcst>=1.1.0
31
+ Requires-Dist: tomli-w>=1.0.0
32
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11"
33
+ Requires-Dist: pathspec>=0.11.0
34
+ Requires-Dist: packaging>=21.0
35
+ Provides-Extra: test
36
+ Requires-Dist: pytest>=7.0.0; extra == "test"
37
+ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
38
+ Requires-Dist: networkx>=3.0; extra == "test"
39
+ Provides-Extra: e2e
40
+ Requires-Dist: playwright>=1.40.0; extra == "e2e"
41
+ Provides-Extra: dev
42
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
43
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
44
+ Requires-Dist: networkx>=3.0; extra == "dev"
45
+ Requires-Dist: playwright>=1.40.0; extra == "dev"
46
+ Requires-Dist: ruff; extra == "dev"
47
+ Requires-Dist: mypy; extra == "dev"
48
+ Dynamic: license-file
49
+
50
+ <p align="center">
51
+ <img src="https://raw.githubusercontent.com/v3ravani/buttress/main/docs/assets/buttress-logo.png" alt="Buttress Logo" width="132" />
52
+ </p>
53
+
54
+ <h1 align="center">Buttress</h1>
55
+
56
+ <p align="center">
57
+ <strong>Offline-first Python architecture governance, dependency graph analysis, and LibCST auto-remediation.</strong>
58
+ </p>
59
+
60
+ <p align="center">
61
+ <a href="https://pypi.org/project/buttress/"><img src="https://img.shields.io/pypi/v/buttress?color=18181b&style=flat-square" alt="PyPI" /></a>
62
+ <img src="https://img.shields.io/badge/python-%3E%3D3.10-18181b?style=flat-square&logo=python&logoColor=white" alt="Python >=3.10" />
63
+ <img src="https://img.shields.io/badge/version-0.2.0-18181b?style=flat-square" alt="Version 0.2.0" />
64
+ <img src="https://img.shields.io/badge/license-Apache--2.0-18181b?style=flat-square" alt="License Apache-2.0" />
65
+ <img src="https://img.shields.io/badge/typing-mypy%20strict-18181b?style=flat-square" alt="mypy strict" />
66
+ <img src="https://img.shields.io/badge/linter-ruff-18181b?style=flat-square" alt="ruff" />
67
+ <img src="https://img.shields.io/badge/telemetry-offline%20only-18181b?style=flat-square" alt="Offline Only" />
68
+ </p>
69
+
70
+ <p align="center">
71
+ <a href="#quick-start">Quick Start</a> &bull;
72
+ <a href="#contracts">Contracts</a> &bull;
73
+ <a href="#auto-remediation">Auto-Remediation</a> &bull;
74
+ <a href="#web-ui--cli">Web UI &amp; CLI</a> &bull;
75
+ <a href="#documentation">Documentation</a>
76
+ </p>
77
+
78
+ ---
79
+
80
+ **Buttress** enforces modular Python architecture locally with zero cloud dependencies or telemetry. It builds an exact module dependency graph cached in SQLite, validates structural contracts and explicit module policies, applies safe LibCST fixes with atomic rollback, tracks debt baselines, filters affected `pytest` targets from git diffs, and includes a loopback Web UI (`buttress show`).
81
+
82
+ ## Table of Contents
83
+
84
+ - [Features](#features)
85
+ - [Installation](#installation)
86
+ - [Quick Start](#quick-start)
87
+ - [Configuration](#configuration)
88
+ - [Contracts](#contracts)
89
+ - [Auto-Remediation](#auto-remediation)
90
+ - [Web UI & CLI](#web-ui--cli)
91
+ - [Python SDK & CI](#python-sdk--ci)
92
+ - [Documentation](#documentation)
93
+
94
+ ---
95
+
96
+ ## Features
97
+
98
+ - **7 Built-in Contracts + Declarative Rules:** Enforce `layers`, `forbidden`, `protected`, `independence`, `acyclic_siblings`, `module_policy` (`[[modules]]`), `public_interface`, and `custom` governance rules.
99
+ - **Dependency Graph & Cache:** Incremental SQLite AST parsing with `Ca`, `Ce`, Instability (`I`), cycle detection, shortest-path traces, and external manifest verification (`buttress check-external`).
100
+ - **LibCST Auto-Remediation:** Automatically fix unused forbidden imports, `if TYPE_CHECKING:` guards, public facade rewrites, lazy imports, and stale inline ignores with SHA-256 verification and `--undo` rollback.
101
+ - **Baselines & Test Impact:** Adopt incrementally with fingerprinted `buttress.baseline.json` regression checks and run only diff-impacted tests via `buttress test` or `pytest --buttress-impact`.
102
+ - **Local Web UI & Reporting:** Inspect graphs, contracts, violations, diffs, and settings in `buttress show` (`127.0.0.1`), or export `JSON`, `SARIF 2.1.0`, `DOT`, and `Mermaid`.
103
+
104
+ ---
105
+
106
+ ## Installation
107
+
108
+ Requires **Python `>= 3.10`**.
109
+
110
+ ```bash
111
+ # Install from PyPI
112
+ pip install buttress
113
+
114
+ # Or isolate globally as a CLI tool with uv
115
+ uv tool install buttress
116
+
117
+ # Optional extras
118
+ pip install "buttress[test]" # pytest + coverage + networkx test helpers
119
+ pip install "buttress[e2e]" # playwright browser automation
120
+ pip install "buttress[dev]" # full contributor toolchain (test, e2e, mypy, ruff)
121
+ ```
122
+
123
+ Or install from source for local development:
124
+
125
+ ```bash
126
+ git clone https://github.com/v3ravani/buttress.git
127
+ cd buttress
128
+ uv sync --extra dev
129
+ uv run buttress doctor
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Quick Start
135
+
136
+ ```bash
137
+ buttress init # Discover source roots and create buttress.toml
138
+ buttress scan # Build dependency graph & warm SQLite cache
139
+ buttress check # Evaluate all contracts and module policies
140
+ buttress show # Open the local Web UI (http://127.0.0.1:8765)
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Configuration
146
+
147
+ Settings load across 5 precedence tiers (`CLI flags` > `BUTTRESS_*` env vars > `buttress.toml` > `[tool.buttress]` in `pyproject.toml` > defaults).
148
+
149
+ ```toml
150
+ source_roots = ["src"]
151
+ project_packages = ["ecommerce"]
152
+ strict = true
153
+ include_type_checking = true
154
+
155
+ [[contracts]]
156
+ name = "Clean Layers"
157
+ type = "layers"
158
+ containers = ["ecommerce"]
159
+ layers = ["web", "services", "domain", "models"]
160
+
161
+ [[contracts]]
162
+ name = "No Domain Web Imports"
163
+ type = "forbidden"
164
+ source_modules = ["ecommerce.domain"]
165
+ forbidden_modules = ["ecommerce.web"]
166
+
167
+ [[modules]]
168
+ path = "ecommerce.models"
169
+ depends_on = []
170
+ cannot_depend_on = ["ecommerce.web"]
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Contracts
176
+
177
+ | Type | Purpose | Key Fields |
178
+ | --- | --- | --- |
179
+ | `forbidden` | Block direct or indirect imports to forbidden targets | `source_modules`, `forbidden_modules` |
180
+ | `protected` | Restrict package imports to approved callers | `packages`, `allowed_importers` |
181
+ | `layers` | Enforce top-down dependency tiers | `layers`, `containers`, `closed` |
182
+ | `independence` | Enforce mutual isolation among peer slices | `modules` |
183
+ | `acyclic_siblings` | Prohibit dependency cycles under a parent package | `parent_package`, `recursive` |
184
+ | `module_policy` | Per-module `depends_on`, `cannot_depend_on`, `visibility` | Declared via `[[modules]]` |
185
+ | `public_interface` | Restrict imports to `__all__` / declared exports | `module_path`, `public_interface` |
186
+ | `custom` | Max fan-out, naming conventions, ownership, allowed/restricted imports | `capability` + rule fields |
187
+
188
+ Suppress a specific line temporarily with `# buttress: ignore[Contract Name]`, and audit rules for conflicts or stale ignores with `buttress contracts audit`. See [docs/contracts.md](https://github.com/v3ravani/buttress/blob/main/docs/contracts.md) for all schemas.
189
+
190
+ ---
191
+
192
+ ## Auto-Remediation
193
+
194
+ Preview safe AST patches, apply atomically with mirrored `.bak` snapshots in `.buttress/backups/`, or roll back cleanly:
195
+
196
+ ```bash
197
+ buttress fix # Preview unified CST diffs without modifying disk
198
+ buttress fix --apply # Apply eligible automatic fixes + verify post-fix
199
+ buttress fix --history # List remediation transaction ledger
200
+ buttress fix --undo <tx_id> # Restore pre-fix file states atomically
201
+ ```
202
+
203
+ Read [docs/remediation.md](https://github.com/v3ravani/buttress/blob/main/docs/remediation.md) for all 6 built-in fixers and SHA-256 conflict guards.
204
+
205
+ ---
206
+
207
+ ## Web UI & CLI
208
+
209
+ Launch the local monochrome dashboard (`127.0.0.1` loopback with strict `Host`, `Origin`, and `CSP` checks):
210
+
211
+ ```bash
212
+ buttress show --port 8765
213
+ ```
214
+
215
+ Common daily CLI workflows:
216
+
217
+ | Command | Action |
218
+ | --- | --- |
219
+ | `buttress check` | Enforce contracts & auto-apply `buttress.baseline.json` (`--no-baseline` to inspect all) |
220
+ | `buttress sync --apply` | Sync `[[modules]]` `depends_on` lists cleanly with real imports |
221
+ | `buttress check-external` | Audit third-party imports against `pyproject.toml` / requirements files |
222
+ | `buttress test --base HEAD~1` | Compute impacted downstream `pytest` files from git diff |
223
+ | `buttress check -f sarif -o buttress.sarif` | Export findings as `sarif`, `json`, `text`, `github`, or `terminal` |
224
+
225
+ Full command options and exit codes (`0` to `130`) are documented in [docs/cli.md](https://github.com/v3ravani/buttress/blob/main/docs/cli.md).
226
+
227
+ ---
228
+
229
+ ## Python SDK & CI
230
+
231
+ ```python
232
+ from pathlib import Path
233
+ from buttress.api import Project
234
+
235
+ project = Project.open(Path("."))
236
+ scan = project.scan()
237
+ active, suppressed, summary = project.check()
238
+ diff = project.compare_baseline(active)
239
+ ```
240
+
241
+ In GitHub Actions, run `buttress check` and export SARIF via `buttress check -f sarif -o buttress.sarif`. For pre-commit, run `buttress install pre-commit`. For `pytest` test filtering, run `pytest --buttress-impact`.
242
+
243
+ ---
244
+
245
+ ## Documentation
246
+
247
+ | Guide | Coverage |
248
+ | --- | --- |
249
+ | [Setup & Installation](https://github.com/v3ravani/buttress/blob/main/docs/setup.md) | `uv` / `pip` setup, monorepos, initialization, and Web UI launch |
250
+ | [Requirements](https://github.com/v3ravani/buttress/blob/main/docs/requirements.md) | Python versions, dependencies, OS support, and runtime constraints |
251
+ | [Contracts Specification](https://github.com/v3ravani/buttress/blob/main/docs/contracts.md) | All 7 contract types, `[[modules]]`, custom capabilities, and audits |
252
+ | [Auto-Remediation](https://github.com/v3ravani/buttress/blob/main/docs/remediation.md) | LibCST transform pipeline, built-in fixers, safety, and rollback |
253
+ | [CLI Reference](https://github.com/v3ravani/buttress/blob/main/docs/cli.md) | Complete CLI commands, global flags, and exit codes |
254
+ | [SDK & REST API Reference](https://github.com/v3ravani/buttress/blob/main/docs/api-reference.md) | Python `buttress.api` SDK and `/api/v1/*` server endpoints |
255
+ | [System Architecture](https://github.com/v3ravani/buttress/blob/main/docs/system-architecture.md) | Package layers, concurrency locking, and atomic persistence |
256
+ | [Data Flow](https://github.com/v3ravani/buttress/blob/main/docs/data-flow.md) | Scan caching, contract evaluation, and remediation pipelines |
257
+ | [Entity Relationships](https://github.com/v3ravani/buttress/blob/main/docs/entity-relationship.md) | Domain models, graph entities, baseline, and transaction records |
258
+ | [Testing Guide](https://github.com/v3ravani/buttress/blob/main/docs/testing.md) | Unit tests, `mypy --strict`, `ruff`, benchmarks, and Playwright E2E |
259
+ | [Security Model](https://github.com/v3ravani/buttress/blob/main/docs/security.md) | Loopback isolation, Host/Origin/CSP checks, sandboxing, and VCS safety |
260
+ | [Troubleshooting](https://github.com/v3ravani/buttress/blob/main/docs/troubleshooting.md) | Error codes (`CFG_*`, `RES_*`, `SEC_*`, `VCS_*`, `REM_*`) and fixes |
261
+ | [Contributing Guide](https://github.com/v3ravani/buttress/blob/main/CONTRIBUTING.md) | Development workflow, verification checklist, and AI contribution rules |
262
+
263
+ ---
264
+
265
+ <p align="center">
266
+ Licensed under the <strong>Apache License 2.0</strong><br />
267
+ Built by <a href="https://www.virajravani.in">Viraj Ravani</a>
268
+ </p>
@@ -0,0 +1,219 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/v3ravani/buttress/main/docs/assets/buttress-logo.png" alt="Buttress Logo" width="132" />
3
+ </p>
4
+
5
+ <h1 align="center">Buttress</h1>
6
+
7
+ <p align="center">
8
+ <strong>Offline-first Python architecture governance, dependency graph analysis, and LibCST auto-remediation.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://pypi.org/project/buttress/"><img src="https://img.shields.io/pypi/v/buttress?color=18181b&style=flat-square" alt="PyPI" /></a>
13
+ <img src="https://img.shields.io/badge/python-%3E%3D3.10-18181b?style=flat-square&logo=python&logoColor=white" alt="Python >=3.10" />
14
+ <img src="https://img.shields.io/badge/version-0.2.0-18181b?style=flat-square" alt="Version 0.2.0" />
15
+ <img src="https://img.shields.io/badge/license-Apache--2.0-18181b?style=flat-square" alt="License Apache-2.0" />
16
+ <img src="https://img.shields.io/badge/typing-mypy%20strict-18181b?style=flat-square" alt="mypy strict" />
17
+ <img src="https://img.shields.io/badge/linter-ruff-18181b?style=flat-square" alt="ruff" />
18
+ <img src="https://img.shields.io/badge/telemetry-offline%20only-18181b?style=flat-square" alt="Offline Only" />
19
+ </p>
20
+
21
+ <p align="center">
22
+ <a href="#quick-start">Quick Start</a> &bull;
23
+ <a href="#contracts">Contracts</a> &bull;
24
+ <a href="#auto-remediation">Auto-Remediation</a> &bull;
25
+ <a href="#web-ui--cli">Web UI &amp; CLI</a> &bull;
26
+ <a href="#documentation">Documentation</a>
27
+ </p>
28
+
29
+ ---
30
+
31
+ **Buttress** enforces modular Python architecture locally with zero cloud dependencies or telemetry. It builds an exact module dependency graph cached in SQLite, validates structural contracts and explicit module policies, applies safe LibCST fixes with atomic rollback, tracks debt baselines, filters affected `pytest` targets from git diffs, and includes a loopback Web UI (`buttress show`).
32
+
33
+ ## Table of Contents
34
+
35
+ - [Features](#features)
36
+ - [Installation](#installation)
37
+ - [Quick Start](#quick-start)
38
+ - [Configuration](#configuration)
39
+ - [Contracts](#contracts)
40
+ - [Auto-Remediation](#auto-remediation)
41
+ - [Web UI & CLI](#web-ui--cli)
42
+ - [Python SDK & CI](#python-sdk--ci)
43
+ - [Documentation](#documentation)
44
+
45
+ ---
46
+
47
+ ## Features
48
+
49
+ - **7 Built-in Contracts + Declarative Rules:** Enforce `layers`, `forbidden`, `protected`, `independence`, `acyclic_siblings`, `module_policy` (`[[modules]]`), `public_interface`, and `custom` governance rules.
50
+ - **Dependency Graph & Cache:** Incremental SQLite AST parsing with `Ca`, `Ce`, Instability (`I`), cycle detection, shortest-path traces, and external manifest verification (`buttress check-external`).
51
+ - **LibCST Auto-Remediation:** Automatically fix unused forbidden imports, `if TYPE_CHECKING:` guards, public facade rewrites, lazy imports, and stale inline ignores with SHA-256 verification and `--undo` rollback.
52
+ - **Baselines & Test Impact:** Adopt incrementally with fingerprinted `buttress.baseline.json` regression checks and run only diff-impacted tests via `buttress test` or `pytest --buttress-impact`.
53
+ - **Local Web UI & Reporting:** Inspect graphs, contracts, violations, diffs, and settings in `buttress show` (`127.0.0.1`), or export `JSON`, `SARIF 2.1.0`, `DOT`, and `Mermaid`.
54
+
55
+ ---
56
+
57
+ ## Installation
58
+
59
+ Requires **Python `>= 3.10`**.
60
+
61
+ ```bash
62
+ # Install from PyPI
63
+ pip install buttress
64
+
65
+ # Or isolate globally as a CLI tool with uv
66
+ uv tool install buttress
67
+
68
+ # Optional extras
69
+ pip install "buttress[test]" # pytest + coverage + networkx test helpers
70
+ pip install "buttress[e2e]" # playwright browser automation
71
+ pip install "buttress[dev]" # full contributor toolchain (test, e2e, mypy, ruff)
72
+ ```
73
+
74
+ Or install from source for local development:
75
+
76
+ ```bash
77
+ git clone https://github.com/v3ravani/buttress.git
78
+ cd buttress
79
+ uv sync --extra dev
80
+ uv run buttress doctor
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Quick Start
86
+
87
+ ```bash
88
+ buttress init # Discover source roots and create buttress.toml
89
+ buttress scan # Build dependency graph & warm SQLite cache
90
+ buttress check # Evaluate all contracts and module policies
91
+ buttress show # Open the local Web UI (http://127.0.0.1:8765)
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Configuration
97
+
98
+ Settings load across 5 precedence tiers (`CLI flags` > `BUTTRESS_*` env vars > `buttress.toml` > `[tool.buttress]` in `pyproject.toml` > defaults).
99
+
100
+ ```toml
101
+ source_roots = ["src"]
102
+ project_packages = ["ecommerce"]
103
+ strict = true
104
+ include_type_checking = true
105
+
106
+ [[contracts]]
107
+ name = "Clean Layers"
108
+ type = "layers"
109
+ containers = ["ecommerce"]
110
+ layers = ["web", "services", "domain", "models"]
111
+
112
+ [[contracts]]
113
+ name = "No Domain Web Imports"
114
+ type = "forbidden"
115
+ source_modules = ["ecommerce.domain"]
116
+ forbidden_modules = ["ecommerce.web"]
117
+
118
+ [[modules]]
119
+ path = "ecommerce.models"
120
+ depends_on = []
121
+ cannot_depend_on = ["ecommerce.web"]
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Contracts
127
+
128
+ | Type | Purpose | Key Fields |
129
+ | --- | --- | --- |
130
+ | `forbidden` | Block direct or indirect imports to forbidden targets | `source_modules`, `forbidden_modules` |
131
+ | `protected` | Restrict package imports to approved callers | `packages`, `allowed_importers` |
132
+ | `layers` | Enforce top-down dependency tiers | `layers`, `containers`, `closed` |
133
+ | `independence` | Enforce mutual isolation among peer slices | `modules` |
134
+ | `acyclic_siblings` | Prohibit dependency cycles under a parent package | `parent_package`, `recursive` |
135
+ | `module_policy` | Per-module `depends_on`, `cannot_depend_on`, `visibility` | Declared via `[[modules]]` |
136
+ | `public_interface` | Restrict imports to `__all__` / declared exports | `module_path`, `public_interface` |
137
+ | `custom` | Max fan-out, naming conventions, ownership, allowed/restricted imports | `capability` + rule fields |
138
+
139
+ Suppress a specific line temporarily with `# buttress: ignore[Contract Name]`, and audit rules for conflicts or stale ignores with `buttress contracts audit`. See [docs/contracts.md](https://github.com/v3ravani/buttress/blob/main/docs/contracts.md) for all schemas.
140
+
141
+ ---
142
+
143
+ ## Auto-Remediation
144
+
145
+ Preview safe AST patches, apply atomically with mirrored `.bak` snapshots in `.buttress/backups/`, or roll back cleanly:
146
+
147
+ ```bash
148
+ buttress fix # Preview unified CST diffs without modifying disk
149
+ buttress fix --apply # Apply eligible automatic fixes + verify post-fix
150
+ buttress fix --history # List remediation transaction ledger
151
+ buttress fix --undo <tx_id> # Restore pre-fix file states atomically
152
+ ```
153
+
154
+ Read [docs/remediation.md](https://github.com/v3ravani/buttress/blob/main/docs/remediation.md) for all 6 built-in fixers and SHA-256 conflict guards.
155
+
156
+ ---
157
+
158
+ ## Web UI & CLI
159
+
160
+ Launch the local monochrome dashboard (`127.0.0.1` loopback with strict `Host`, `Origin`, and `CSP` checks):
161
+
162
+ ```bash
163
+ buttress show --port 8765
164
+ ```
165
+
166
+ Common daily CLI workflows:
167
+
168
+ | Command | Action |
169
+ | --- | --- |
170
+ | `buttress check` | Enforce contracts & auto-apply `buttress.baseline.json` (`--no-baseline` to inspect all) |
171
+ | `buttress sync --apply` | Sync `[[modules]]` `depends_on` lists cleanly with real imports |
172
+ | `buttress check-external` | Audit third-party imports against `pyproject.toml` / requirements files |
173
+ | `buttress test --base HEAD~1` | Compute impacted downstream `pytest` files from git diff |
174
+ | `buttress check -f sarif -o buttress.sarif` | Export findings as `sarif`, `json`, `text`, `github`, or `terminal` |
175
+
176
+ Full command options and exit codes (`0` to `130`) are documented in [docs/cli.md](https://github.com/v3ravani/buttress/blob/main/docs/cli.md).
177
+
178
+ ---
179
+
180
+ ## Python SDK & CI
181
+
182
+ ```python
183
+ from pathlib import Path
184
+ from buttress.api import Project
185
+
186
+ project = Project.open(Path("."))
187
+ scan = project.scan()
188
+ active, suppressed, summary = project.check()
189
+ diff = project.compare_baseline(active)
190
+ ```
191
+
192
+ In GitHub Actions, run `buttress check` and export SARIF via `buttress check -f sarif -o buttress.sarif`. For pre-commit, run `buttress install pre-commit`. For `pytest` test filtering, run `pytest --buttress-impact`.
193
+
194
+ ---
195
+
196
+ ## Documentation
197
+
198
+ | Guide | Coverage |
199
+ | --- | --- |
200
+ | [Setup & Installation](https://github.com/v3ravani/buttress/blob/main/docs/setup.md) | `uv` / `pip` setup, monorepos, initialization, and Web UI launch |
201
+ | [Requirements](https://github.com/v3ravani/buttress/blob/main/docs/requirements.md) | Python versions, dependencies, OS support, and runtime constraints |
202
+ | [Contracts Specification](https://github.com/v3ravani/buttress/blob/main/docs/contracts.md) | All 7 contract types, `[[modules]]`, custom capabilities, and audits |
203
+ | [Auto-Remediation](https://github.com/v3ravani/buttress/blob/main/docs/remediation.md) | LibCST transform pipeline, built-in fixers, safety, and rollback |
204
+ | [CLI Reference](https://github.com/v3ravani/buttress/blob/main/docs/cli.md) | Complete CLI commands, global flags, and exit codes |
205
+ | [SDK & REST API Reference](https://github.com/v3ravani/buttress/blob/main/docs/api-reference.md) | Python `buttress.api` SDK and `/api/v1/*` server endpoints |
206
+ | [System Architecture](https://github.com/v3ravani/buttress/blob/main/docs/system-architecture.md) | Package layers, concurrency locking, and atomic persistence |
207
+ | [Data Flow](https://github.com/v3ravani/buttress/blob/main/docs/data-flow.md) | Scan caching, contract evaluation, and remediation pipelines |
208
+ | [Entity Relationships](https://github.com/v3ravani/buttress/blob/main/docs/entity-relationship.md) | Domain models, graph entities, baseline, and transaction records |
209
+ | [Testing Guide](https://github.com/v3ravani/buttress/blob/main/docs/testing.md) | Unit tests, `mypy --strict`, `ruff`, benchmarks, and Playwright E2E |
210
+ | [Security Model](https://github.com/v3ravani/buttress/blob/main/docs/security.md) | Loopback isolation, Host/Origin/CSP checks, sandboxing, and VCS safety |
211
+ | [Troubleshooting](https://github.com/v3ravani/buttress/blob/main/docs/troubleshooting.md) | Error codes (`CFG_*`, `RES_*`, `SEC_*`, `VCS_*`, `REM_*`) and fixes |
212
+ | [Contributing Guide](https://github.com/v3ravani/buttress/blob/main/CONTRIBUTING.md) | Development workflow, verification checklist, and AI contribution rules |
213
+
214
+ ---
215
+
216
+ <p align="center">
217
+ Licensed under the <strong>Apache License 2.0</strong><br />
218
+ Built by <a href="https://www.virajravani.in">Viraj Ravani</a>
219
+ </p>
@@ -0,0 +1,121 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "buttress"
7
+ version = "0.2.0"
8
+ description = "Python architecture governance, dependency graph analysis, and LibCST auto-remediation."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ {name = "viraj ravani", email = "ravaniviraj@gmail.com"}
15
+ ]
16
+ keywords = [
17
+ "architecture",
18
+ "dependency-analysis",
19
+ "import-linter",
20
+ "tach",
21
+ "static-analysis",
22
+ "layer-architecture",
23
+ "linter"
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 5 - Production/Stable",
27
+ "Intended Audience :: Developers",
28
+ "Operating System :: OS Independent",
29
+ "Programming Language :: Python :: 3",
30
+ "Programming Language :: Python :: 3.10",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
34
+ "Programming Language :: Python :: 3.14",
35
+ "Topic :: Software Development :: Quality Assurance",
36
+ "Topic :: Software Development :: Testing",
37
+ ]
38
+
39
+ dependencies = [
40
+ "click>=8.1.0",
41
+ "rich>=13.0.0",
42
+ "pydantic>=2.5.0",
43
+ "grimp>=3.2.0",
44
+ "libcst>=1.1.0",
45
+ "tomli-w>=1.0.0",
46
+ "tomli>=2.0.0; python_version < '3.11'",
47
+ "pathspec>=0.11.0",
48
+ "packaging>=21.0",
49
+ ]
50
+
51
+ [project.optional-dependencies]
52
+ test = [
53
+ "pytest>=7.0.0",
54
+ "pytest-cov>=4.0.0",
55
+ "networkx>=3.0",
56
+ ]
57
+ e2e = [
58
+ "playwright>=1.40.0",
59
+ ]
60
+ dev = [
61
+ "pytest>=7.0.0",
62
+ "pytest-cov>=4.0.0",
63
+ "networkx>=3.0",
64
+ "playwright>=1.40.0",
65
+ "ruff",
66
+ "mypy",
67
+ ]
68
+
69
+ [project.urls]
70
+ Homepage = "https://github.com/v3ravani/buttress"
71
+ Repository = "https://github.com/v3ravani/buttress"
72
+ Issues = "https://github.com/v3ravani/buttress/issues"
73
+ Changelog = "https://github.com/v3ravani/buttress/blob/main/CHANGELOG.md"
74
+
75
+ [project.scripts]
76
+ buttress = "buttress.cli.entrypoint:cli"
77
+
78
+ [project.entry-points.pytest11]
79
+ buttress = "buttress.integrations.pytest_plugin"
80
+
81
+ [tool.setuptools.packages.find]
82
+ where = ["src"]
83
+
84
+ [tool.setuptools.package-data]
85
+ buttress = ["py.typed", "server/static/**/*"]
86
+
87
+ [tool.pytest.ini_options]
88
+ minversion = "7.0"
89
+ testpaths = ["tests"]
90
+ python_files = ["test_*.py"]
91
+ python_classes = ["Test*"]
92
+ python_functions = ["test_*"]
93
+ addopts = "-v --strict-markers"
94
+ asyncio_mode = "strict"
95
+ asyncio_default_fixture_loop_scope = "function"
96
+
97
+ [tool.ruff]
98
+ line-length = 100
99
+ target-version = "py310"
100
+
101
+ [tool.ruff.lint]
102
+ select = ["E", "F", "W", "B", "I"]
103
+ ignore = ["E501"]
104
+
105
+ [tool.mypy]
106
+ python_version = "3.10"
107
+ strict = true
108
+ warn_unused_configs = true
109
+ disallow_untyped_defs = true
110
+ disallow_incomplete_defs = true
111
+ check_untyped_defs = true
112
+ no_implicit_optional = true
113
+ warn_redundant_casts = true
114
+ warn_unused_ignores = true
115
+ warn_return_any = true
116
+
117
+ [[tool.mypy.overrides]]
118
+ module = ["tomli"]
119
+ ignore_missing_imports = true
120
+
121
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+