chesterton 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Blueangelman36
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,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: chesterton
3
+ Version: 0.1.1
4
+ Summary: Remember why code exists, and speak up before it's removed.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/Blueangelman36/chesterton
7
+ Project-URL: Repository, https://github.com/Blueangelman36/chesterton
8
+ Project-URL: Issues, https://github.com/Blueangelman36/chesterton/issues
9
+ Keywords: git,hooks,pre-commit,code-review,documentation,refactoring
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Quality Assurance
19
+ Classifier: Topic :: Software Development :: Version Control :: Git
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Dynamic: license-file
24
+
25
+ # chesterton
26
+
27
+ *Don't take down a fence until you know why it was put up.*
28
+
29
+ `fence` remembers **why** code exists, and speaks up when a commit is about to delete it.
30
+
31
+ Some of the most painful bugs start the same way: someone removes a strange-looking retry loop,
32
+ a `sleep(50)`, or an `if` that "can't happen", and it turns out it could. The person who wrote it
33
+ knew why. That reason lived in a closed pull request, a chat thread, or their head, and none of
34
+ those are open when the next person edits the file.
35
+
36
+ Notes are pinned to statements in the syntax tree rather than to line numbers, so they follow the
37
+ code through reformatting, identifier renames, and moves between files.
38
+
39
+ ```bash
40
+ pip install chesterton
41
+ cd your-project
42
+ fence init
43
+ fence add src/client.py:42 -m "Vendor API returns 200 on auth failure; the error is in the body."
44
+ ```
45
+
46
+ Later, when someone deletes that check:
47
+
48
+ ```text
49
+ $ git commit -m "Simplify fetch"
50
+ [REMOVED] 1559744b src/client.py:42 in Client.fetch
51
+ why: Vendor API returns 200 on auth failure; the error is in the body.
52
+ was: if resp.json().get("error") == "unauthorized":
53
+
54
+ fence: 1 note(s) checked: 1 REMOVED
55
+ reason no longer applies? fence retire <id> -m "what changed"
56
+ code lives somewhere new? fence reanchor <id> <file>:<line>
57
+ commit anyway? git commit --no-verify
58
+ ```
59
+
60
+ Renaming or moving that code instead blocks nothing — the note follows it.
61
+
62
+ ## For coding agents
63
+
64
+ ```bash
65
+ fence why src/client.py --json # before changing code you did not write
66
+ fence check --json # what a blocked commit is objecting to
67
+ fence init --agents # write the instructions where agents will find them
68
+ ```
69
+
70
+ ## Status
71
+
72
+ A prototype of the core loop: anchoring plus the hook. **Python source only** — the design is not
73
+ Python-specific, and a tree-sitter implementation for other languages is in progress. Measured
74
+ against requests, flask, pytest, django and a slice of the standard library (3,613 files): no
75
+ false alarms, and every deliberate deletion caught.
76
+
77
+ No dependencies. Python 3.11+. <!-- asof:python-version --> MIT licensed.
78
+
79
+ Full documentation, the note format specification, and the conformance suite live in the
80
+ repository.
@@ -0,0 +1,56 @@
1
+ # chesterton
2
+
3
+ *Don't take down a fence until you know why it was put up.*
4
+
5
+ `fence` remembers **why** code exists, and speaks up when a commit is about to delete it.
6
+
7
+ Some of the most painful bugs start the same way: someone removes a strange-looking retry loop,
8
+ a `sleep(50)`, or an `if` that "can't happen", and it turns out it could. The person who wrote it
9
+ knew why. That reason lived in a closed pull request, a chat thread, or their head, and none of
10
+ those are open when the next person edits the file.
11
+
12
+ Notes are pinned to statements in the syntax tree rather than to line numbers, so they follow the
13
+ code through reformatting, identifier renames, and moves between files.
14
+
15
+ ```bash
16
+ pip install chesterton
17
+ cd your-project
18
+ fence init
19
+ fence add src/client.py:42 -m "Vendor API returns 200 on auth failure; the error is in the body."
20
+ ```
21
+
22
+ Later, when someone deletes that check:
23
+
24
+ ```text
25
+ $ git commit -m "Simplify fetch"
26
+ [REMOVED] 1559744b src/client.py:42 in Client.fetch
27
+ why: Vendor API returns 200 on auth failure; the error is in the body.
28
+ was: if resp.json().get("error") == "unauthorized":
29
+
30
+ fence: 1 note(s) checked: 1 REMOVED
31
+ reason no longer applies? fence retire <id> -m "what changed"
32
+ code lives somewhere new? fence reanchor <id> <file>:<line>
33
+ commit anyway? git commit --no-verify
34
+ ```
35
+
36
+ Renaming or moving that code instead blocks nothing — the note follows it.
37
+
38
+ ## For coding agents
39
+
40
+ ```bash
41
+ fence why src/client.py --json # before changing code you did not write
42
+ fence check --json # what a blocked commit is objecting to
43
+ fence init --agents # write the instructions where agents will find them
44
+ ```
45
+
46
+ ## Status
47
+
48
+ A prototype of the core loop: anchoring plus the hook. **Python source only** — the design is not
49
+ Python-specific, and a tree-sitter implementation for other languages is in progress. Measured
50
+ against requests, flask, pytest, django and a slice of the standard library (3,613 files): no
51
+ false alarms, and every deliberate deletion caught.
52
+
53
+ No dependencies. Python 3.11+. <!-- asof:python-version --> MIT licensed.
54
+
55
+ Full documentation, the note format specification, and the conformance suite live in the
56
+ repository.
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: chesterton
3
+ Version: 0.1.1
4
+ Summary: Remember why code exists, and speak up before it's removed.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/Blueangelman36/chesterton
7
+ Project-URL: Repository, https://github.com/Blueangelman36/chesterton
8
+ Project-URL: Issues, https://github.com/Blueangelman36/chesterton/issues
9
+ Keywords: git,hooks,pre-commit,code-review,documentation,refactoring
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Quality Assurance
19
+ Classifier: Topic :: Software Development :: Version Control :: Git
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Dynamic: license-file
24
+
25
+ # chesterton
26
+
27
+ *Don't take down a fence until you know why it was put up.*
28
+
29
+ `fence` remembers **why** code exists, and speaks up when a commit is about to delete it.
30
+
31
+ Some of the most painful bugs start the same way: someone removes a strange-looking retry loop,
32
+ a `sleep(50)`, or an `if` that "can't happen", and it turns out it could. The person who wrote it
33
+ knew why. That reason lived in a closed pull request, a chat thread, or their head, and none of
34
+ those are open when the next person edits the file.
35
+
36
+ Notes are pinned to statements in the syntax tree rather than to line numbers, so they follow the
37
+ code through reformatting, identifier renames, and moves between files.
38
+
39
+ ```bash
40
+ pip install chesterton
41
+ cd your-project
42
+ fence init
43
+ fence add src/client.py:42 -m "Vendor API returns 200 on auth failure; the error is in the body."
44
+ ```
45
+
46
+ Later, when someone deletes that check:
47
+
48
+ ```text
49
+ $ git commit -m "Simplify fetch"
50
+ [REMOVED] 1559744b src/client.py:42 in Client.fetch
51
+ why: Vendor API returns 200 on auth failure; the error is in the body.
52
+ was: if resp.json().get("error") == "unauthorized":
53
+
54
+ fence: 1 note(s) checked: 1 REMOVED
55
+ reason no longer applies? fence retire <id> -m "what changed"
56
+ code lives somewhere new? fence reanchor <id> <file>:<line>
57
+ commit anyway? git commit --no-verify
58
+ ```
59
+
60
+ Renaming or moving that code instead blocks nothing — the note follows it.
61
+
62
+ ## For coding agents
63
+
64
+ ```bash
65
+ fence why src/client.py --json # before changing code you did not write
66
+ fence check --json # what a blocked commit is objecting to
67
+ fence init --agents # write the instructions where agents will find them
68
+ ```
69
+
70
+ ## Status
71
+
72
+ A prototype of the core loop: anchoring plus the hook. **Python source only** — the design is not
73
+ Python-specific, and a tree-sitter implementation for other languages is in progress. Measured
74
+ against requests, flask, pytest, django and a slice of the standard library (3,613 files): no
75
+ false alarms, and every deliberate deletion caught.
76
+
77
+ No dependencies. Python 3.11+. <!-- asof:python-version --> MIT licensed.
78
+
79
+ Full documentation, the note format specification, and the conformance suite live in the
80
+ repository.
@@ -0,0 +1,23 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ chesterton.egg-info/PKG-INFO
5
+ chesterton.egg-info/SOURCES.txt
6
+ chesterton.egg-info/dependency_links.txt
7
+ chesterton.egg-info/entry_points.txt
8
+ chesterton.egg-info/top_level.txt
9
+ fence/__init__.py
10
+ fence/__main__.py
11
+ fence/anchor.py
12
+ fence/cache.py
13
+ fence/cli.py
14
+ fence/gitutil.py
15
+ fence/store.py
16
+ fence/suggest.py
17
+ tests/test_anchor.py
18
+ tests/test_cache.py
19
+ tests/test_cli.py
20
+ tests/test_conformance.py
21
+ tests/test_golden.py
22
+ tests/test_pr_comment.py
23
+ tests/test_suggest.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ fence = fence.cli:main
@@ -0,0 +1 @@
1
+ fence
@@ -0,0 +1,7 @@
1
+ """Remember why code exists, and speak up before it's removed."""
2
+
3
+ __version__ = "0.1.1"
4
+
5
+
6
+ class FenceError(Exception):
7
+ """A problem worth showing the user as-is, without a traceback."""
@@ -0,0 +1,3 @@
1
+ from fence.cli import main
2
+
3
+ raise SystemExit(main())