shiplock 0.0.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.
shiplock-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mo Shehu
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,4 @@
1
+ # The test suite runs from the repo, where its conftest and the repo's own
2
+ # shiplock.toml exist; setuptools' default template would ship tests/test*.py
3
+ # without either, a suite that can't run. Ship the package alone.
4
+ prune tests
@@ -0,0 +1,151 @@
1
+ Metadata-Version: 2.4
2
+ Name: shiplock
3
+ Version: 0.0.1
4
+ Summary: Deterministic docs-vs-code release checks, config-driven per repo, runnable locally, in pytest, and in CI.
5
+ Author: Mo Shehu
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/shehuphd/shiplock
8
+ Keywords: documentation,release,ci,docs-vs-code,linter
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Topic :: Software Development :: Quality Assurance
17
+ Classifier: Topic :: Software Development :: Documentation
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: tomli>=2.0; python_version < "3.11"
22
+ Provides-Extra: test
23
+ Requires-Dist: pytest>=8; extra == "test"
24
+ Requires-Dist: pytest-randomly>=3.15; extra == "test"
25
+ Requires-Dist: pyyaml>=6; extra == "test"
26
+ Requires-Dist: rates; extra == "test"
27
+ Dynamic: license-file
28
+
29
+ # Shiplock
30
+
31
+ Shiplock is a release gate that checks a repository's documentation against its
32
+ own code. It catches the drift that shows up at ship time: a doc describing a
33
+ provider set the code no longer has, a README missing a shipped feature, a
34
+ version string that moved in one file and not another, an example file that fell
35
+ behind the API it demonstrates.
36
+
37
+ It runs the same way in three places — your terminal, your test suite, and CI —
38
+ off one config file per repo, so the check that blocks a release is the check you
39
+ ran locally a minute earlier.
40
+
41
+ ## Before you start
42
+
43
+ Shiplock needs Python 3.10 or newer. Check with:
44
+
45
+ ```bash
46
+ python3 --version
47
+ ```
48
+
49
+ If that fails, install Python from [python.org/downloads](https://www.python.org/downloads/)
50
+ (or your platform package manager: `apt install python3-pip`, `dnf install python3-pip`).
51
+
52
+ ## Install
53
+
54
+ ```bash
55
+ pip install shiplock
56
+ ```
57
+
58
+ ## See it work
59
+
60
+ Point it at any repo — no config file, no setup:
61
+
62
+ ```bash
63
+ shiplock check path/to/your/repo
64
+ ```
65
+
66
+ (or `shiplock check` from inside one). Shiplock sweeps whichever docs it
67
+ recognizes and reports what it finds, one finding per problem:
68
+
69
+ ```
70
+ docs-exist USAGE.md
71
+ declared public doc is missing: USAGE.md
72
+ readme-links README.md:31
73
+ relative link 'USAGE.md' (PyPI resolves it against pypi.org, not the repo)
74
+ ```
75
+
76
+ Findings print to stdout; notices for the checks that need configuration, and
77
+ the run summary, print to stderr — so stdout stays clean for a pipe. Exit code 0
78
+ means clean, 1 means a check found a problem, 2 means a config or usage error.
79
+ That makes `shiplock check` a drop-in CI step and a pytest assertion alike.
80
+ `--json` swaps the human output for one machine-readable object. On a terminal,
81
+ findings render red and a clean run green (`NO_COLOR` turns that off); piped
82
+ output stays plain.
83
+
84
+ When you want the rest of the checks — version alignment, architecture and
85
+ manifest coverage, object documentation, versioned-file markers — add a
86
+ `shiplock.toml` declaring your repo's surfaces. The full schema, section by
87
+ section, is in
88
+ [USAGE.md](https://github.com/shehuphd/shiplock/blob/main/USAGE.md).
89
+
90
+ ## Two layers
91
+
92
+ Shiplock checks in two layers:
93
+
94
+ 1. **Deterministic checks** (`shiplock check`) — fast, exact, no model. Missing
95
+ docs, banned words, internal references in public docs, absolute README
96
+ links, version alignment, the architecture module list, object coverage,
97
+ the per-file manifest, versioned-file markers.
98
+ 2. **A semantic audit** (`shiplock prompt`) — the prompt for a fresh agent to
99
+ read the code and hold every doc claim against it, from state rather than
100
+ from what changed. Centrally versioned inside the package, so every repo gets
101
+ prompt updates on the next install.
102
+
103
+ Print the audit prompt with:
104
+
105
+ ```bash
106
+ shiplock prompt
107
+ ```
108
+
109
+ ## In Python
110
+
111
+ Everything the CLI does is callable — `load_config` and `run_checks` return a
112
+ typed report, so the gate can run inside a test suite:
113
+
114
+ ```python
115
+ from pathlib import Path
116
+ from shiplock import load_config, run_checks
117
+
118
+ def test_docs_match_code():
119
+ report = run_checks(load_config(Path(__file__).parent.parent))
120
+ assert report.ok, [f.message for f in report.findings]
121
+ ```
122
+
123
+ The full API surface is in
124
+ [USAGE.md](https://github.com/shehuphd/shiplock/blob/main/USAGE.md).
125
+
126
+ ## In CI
127
+
128
+ Shiplock ships a reusable GitHub Actions workflow that runs both layers on
129
+ every push and pull request, and opens an issue when the audit fails:
130
+
131
+ ```yaml
132
+ jobs:
133
+ gate:
134
+ uses: shehuphd/shiplock/.github/workflows/gate.yml@main
135
+ ```
136
+
137
+ The full wiring — inputs, the audit's API key, the dormant-first rollout — is in
138
+ [USAGE.md](https://github.com/shehuphd/shiplock/blob/main/USAGE.md).
139
+
140
+ ## Documentation
141
+
142
+ - [USAGE.md](https://github.com/shehuphd/shiplock/blob/main/USAGE.md) — the full manual: config schema, every check, exit codes.
143
+ - [ARCHITECTURE.md](https://github.com/shehuphd/shiplock/blob/main/ARCHITECTURE.md) — how the package is put together.
144
+ - [MANIFEST.md](https://github.com/shehuphd/shiplock/blob/main/MANIFEST.md) — a per-file map of the codebase.
145
+ - [CHANGELOG.md](https://github.com/shehuphd/shiplock/blob/main/CHANGELOG.md) — dated release notes.
146
+
147
+ ## License
148
+
149
+ MIT. See [LICENSE](https://github.com/shehuphd/shiplock/blob/main/LICENSE).
150
+
151
+ By [Mo Shehu](https://mohammedshehu.com)
@@ -0,0 +1,123 @@
1
+ # Shiplock
2
+
3
+ Shiplock is a release gate that checks a repository's documentation against its
4
+ own code. It catches the drift that shows up at ship time: a doc describing a
5
+ provider set the code no longer has, a README missing a shipped feature, a
6
+ version string that moved in one file and not another, an example file that fell
7
+ behind the API it demonstrates.
8
+
9
+ It runs the same way in three places — your terminal, your test suite, and CI —
10
+ off one config file per repo, so the check that blocks a release is the check you
11
+ ran locally a minute earlier.
12
+
13
+ ## Before you start
14
+
15
+ Shiplock needs Python 3.10 or newer. Check with:
16
+
17
+ ```bash
18
+ python3 --version
19
+ ```
20
+
21
+ If that fails, install Python from [python.org/downloads](https://www.python.org/downloads/)
22
+ (or your platform package manager: `apt install python3-pip`, `dnf install python3-pip`).
23
+
24
+ ## Install
25
+
26
+ ```bash
27
+ pip install shiplock
28
+ ```
29
+
30
+ ## See it work
31
+
32
+ Point it at any repo — no config file, no setup:
33
+
34
+ ```bash
35
+ shiplock check path/to/your/repo
36
+ ```
37
+
38
+ (or `shiplock check` from inside one). Shiplock sweeps whichever docs it
39
+ recognizes and reports what it finds, one finding per problem:
40
+
41
+ ```
42
+ docs-exist USAGE.md
43
+ declared public doc is missing: USAGE.md
44
+ readme-links README.md:31
45
+ relative link 'USAGE.md' (PyPI resolves it against pypi.org, not the repo)
46
+ ```
47
+
48
+ Findings print to stdout; notices for the checks that need configuration, and
49
+ the run summary, print to stderr — so stdout stays clean for a pipe. Exit code 0
50
+ means clean, 1 means a check found a problem, 2 means a config or usage error.
51
+ That makes `shiplock check` a drop-in CI step and a pytest assertion alike.
52
+ `--json` swaps the human output for one machine-readable object. On a terminal,
53
+ findings render red and a clean run green (`NO_COLOR` turns that off); piped
54
+ output stays plain.
55
+
56
+ When you want the rest of the checks — version alignment, architecture and
57
+ manifest coverage, object documentation, versioned-file markers — add a
58
+ `shiplock.toml` declaring your repo's surfaces. The full schema, section by
59
+ section, is in
60
+ [USAGE.md](https://github.com/shehuphd/shiplock/blob/main/USAGE.md).
61
+
62
+ ## Two layers
63
+
64
+ Shiplock checks in two layers:
65
+
66
+ 1. **Deterministic checks** (`shiplock check`) — fast, exact, no model. Missing
67
+ docs, banned words, internal references in public docs, absolute README
68
+ links, version alignment, the architecture module list, object coverage,
69
+ the per-file manifest, versioned-file markers.
70
+ 2. **A semantic audit** (`shiplock prompt`) — the prompt for a fresh agent to
71
+ read the code and hold every doc claim against it, from state rather than
72
+ from what changed. Centrally versioned inside the package, so every repo gets
73
+ prompt updates on the next install.
74
+
75
+ Print the audit prompt with:
76
+
77
+ ```bash
78
+ shiplock prompt
79
+ ```
80
+
81
+ ## In Python
82
+
83
+ Everything the CLI does is callable — `load_config` and `run_checks` return a
84
+ typed report, so the gate can run inside a test suite:
85
+
86
+ ```python
87
+ from pathlib import Path
88
+ from shiplock import load_config, run_checks
89
+
90
+ def test_docs_match_code():
91
+ report = run_checks(load_config(Path(__file__).parent.parent))
92
+ assert report.ok, [f.message for f in report.findings]
93
+ ```
94
+
95
+ The full API surface is in
96
+ [USAGE.md](https://github.com/shehuphd/shiplock/blob/main/USAGE.md).
97
+
98
+ ## In CI
99
+
100
+ Shiplock ships a reusable GitHub Actions workflow that runs both layers on
101
+ every push and pull request, and opens an issue when the audit fails:
102
+
103
+ ```yaml
104
+ jobs:
105
+ gate:
106
+ uses: shehuphd/shiplock/.github/workflows/gate.yml@main
107
+ ```
108
+
109
+ The full wiring — inputs, the audit's API key, the dormant-first rollout — is in
110
+ [USAGE.md](https://github.com/shehuphd/shiplock/blob/main/USAGE.md).
111
+
112
+ ## Documentation
113
+
114
+ - [USAGE.md](https://github.com/shehuphd/shiplock/blob/main/USAGE.md) — the full manual: config schema, every check, exit codes.
115
+ - [ARCHITECTURE.md](https://github.com/shehuphd/shiplock/blob/main/ARCHITECTURE.md) — how the package is put together.
116
+ - [MANIFEST.md](https://github.com/shehuphd/shiplock/blob/main/MANIFEST.md) — a per-file map of the codebase.
117
+ - [CHANGELOG.md](https://github.com/shehuphd/shiplock/blob/main/CHANGELOG.md) — dated release notes.
118
+
119
+ ## License
120
+
121
+ MIT. See [LICENSE](https://github.com/shehuphd/shiplock/blob/main/LICENSE).
122
+
123
+ By [Mo Shehu](https://mohammedshehu.com)
@@ -0,0 +1,50 @@
1
+ [build-system]
2
+ # SPDX license expressions (license = "MIT") need setuptools 77.0.3 or newer.
3
+ requires = ["setuptools>=77.0.3"]
4
+ build-backend = "setuptools.build_meta"
5
+
6
+ [project]
7
+ name = "shiplock"
8
+ version = "0.0.1"
9
+ description = "Deterministic docs-vs-code release checks, config-driven per repo, runnable locally, in pytest, and in CI."
10
+ readme = "README.md"
11
+ requires-python = ">=3.10"
12
+ license = "MIT"
13
+ authors = [{ name = "Mo Shehu" }]
14
+ keywords = ["documentation", "release", "ci", "docs-vs-code", "linter"]
15
+ classifiers = [
16
+ "Development Status :: 5 - Production/Stable",
17
+ "Intended Audience :: Developers",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Topic :: Software Development :: Quality Assurance",
24
+ "Topic :: Software Development :: Documentation",
25
+ ]
26
+ dependencies = [
27
+ # tomllib is stdlib from 3.11; the tomli backport covers 3.10 only.
28
+ "tomli>=2.0; python_version < '3.11'",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ test = ["pytest>=8", "pytest-randomly>=3.15", "pyyaml>=6", "rates"]
33
+
34
+ [project.urls]
35
+ Homepage = "https://github.com/shehuphd/shiplock"
36
+
37
+ [project.scripts]
38
+ shiplock = "shiplock.cli:main"
39
+
40
+ [tool.pytest.ini_options]
41
+ # Fail loudly if the randomizer isn't installed, rather than silently running
42
+ # tests in a fixed order.
43
+ required_plugins = ["pytest-randomly"]
44
+ testpaths = ["tests"]
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+
49
+ [tool.setuptools.package-data]
50
+ shiplock = ["py.typed", "prompts/*.md"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,23 @@
1
+ """Shiplock: deterministic docs-vs-code release checks.
2
+
3
+ The public surface is small on purpose. Most callers want either the CLI
4
+ (``shiplock check`` / ``shiplock prompt``) or the two entry points re-exported
5
+ here: load a repo's config, then run the checks over it.
6
+ """
7
+
8
+ from shiplock._config import Config, ConfigError, load_config
9
+ from shiplock._report import Finding, Notice, Report
10
+ from shiplock._checks import run_checks
11
+
12
+ __version__ = "0.0.1"
13
+
14
+ __all__ = [
15
+ "Config",
16
+ "ConfigError",
17
+ "Finding",
18
+ "Notice",
19
+ "Report",
20
+ "load_config",
21
+ "run_checks",
22
+ "__version__",
23
+ ]