Skip to main content

Shiplock

Shiplock is a release gate that checks a repository's documentation against its own code. It catches the drift that shows up at ship time: a doc describing a provider set the code no longer has, a README missing a shipped feature, a version string that moved in one file and not another, an example file that fell behind the API it demonstrates.

It runs the same way in three places — your terminal, your test suite, and CI — off one config file per repo, so the check that blocks a release is the check you ran locally a minute earlier.

Before you start

Shiplock needs Python 3.10 or newer. Check with:

python3 --version

If that fails, install Python from python.org/downloads (or your platform package manager: apt install python3-pip, dnf install python3-pip).

Install

pip install shiplock

See it work

Point it at any repo — no config file, no setup:

shiplock check path/to/your/repo

(or shiplock check from inside one). Shiplock sweeps whichever docs it recognizes and reports what it finds, one finding per problem:

docs-exist  USAGE.md
    declared public doc is missing: USAGE.md
readme-links  README.md:31
    relative link 'USAGE.md' (PyPI resolves it against pypi.org, not the repo)

Findings print to stdout; notices for the checks that need configuration, and the run summary, print to stderr — so stdout stays clean for a pipe. Exit code 0 means clean, 1 means a check found a problem, 2 means a config or usage error. That makes shiplock check a drop-in CI step and a pytest assertion alike. --json swaps the human output for one machine-readable object. On a terminal, findings render red and a clean run green (NO_COLOR turns that off); piped output stays plain.

When you want the rest of the checks — version alignment, architecture and manifest coverage, object documentation, versioned-file markers — add a shiplock.toml declaring your repo's surfaces. The full schema, section by section, is in USAGE.md.

Two layers

Shiplock checks in two layers:

  1. Deterministic checks (shiplock check) — fast, exact, no model. Missing docs, banned words, internal references in public docs, absolute README links, version alignment, the architecture module list, object coverage, the per-file manifest, versioned-file markers, dependency declarations duplicated between pyproject and requirements files, tests that carry no assertion.
  2. A semantic audit (shiplock prompt) — the prompt for a fresh agent to read the code and hold every doc claim against it, from state rather than from what changed. Centrally versioned inside the package, so every repo gets prompt updates on the next install.

Print the audit prompt with:

shiplock prompt

There's also a second, advisory prompt, outside the gate: shiplock prompt ablation prints a prompt for an agent to report what the repo could remove, merge, or make cheaper, with findings split into mechanical folds and decisions for the owner. It renders a report, never a verdict.

In Python

Everything the CLI does is callable — load_config and run_checks return a typed report, so the gate can run inside a test suite:

from pathlib import Path
from shiplock import load_config, run_checks

def test_docs_match_code():
    report = run_checks(load_config(Path(__file__).parent.parent))
    assert report.ok, [f.message for f in report.findings]

The full API surface is in USAGE.md.

In CI

Shiplock ships a reusable GitHub Actions workflow that runs both layers on every push and pull request, and opens an issue when the audit fails:

jobs:
  gate:
    uses: shehuphd/shiplock/.github/workflows/gate.yml@main

The gate installs the checked-out repo only when its config uses a check that imports the package (version or coverage), which it decides by running shiplock needs-import. An app repo that configures neither runs the gate without being an installable package.

The full wiring — inputs, the audit's API key, the dormant-first rollout — is in USAGE.md.

Documentation

License

MIT. See LICENSE.

By Mo Shehu

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shiplock-0.5.0.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shiplock-0.5.0-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file shiplock-0.5.0.tar.gz.

File metadata

  • Download URL: shiplock-0.5.0.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for shiplock-0.5.0.tar.gz
Algorithm Hash digest
SHA256 0d76662379b56d2420edd78b0b38bda9d2b0dc7bf3fb39f98c9976cd0474b0c1
MD5 f0942792e013636249e45ac2d5d57997
BLAKE2b-256 4747206bf3ed091a305517ae35e98e5b962e016fea18df6b5440b77128789f6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for shiplock-0.5.0.tar.gz:

Publisher: release.yml on shehuphd/shiplock

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shiplock-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: shiplock-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for shiplock-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 853ed115bdf8fd6b2fb0359198316aadfce8cc2f9cc9ef41e11533cde18ed5c0
MD5 6f7325ac0bd61b145eaf8ca024ee6578
BLAKE2b-256 d059464b552d7a8a7a011af51d2a724a6c9c022ea548da939505001479760012

See more details on using hashes here.

Provenance

The following attestation bundles were made for shiplock-0.5.0-py3-none-any.whl:

Publisher: release.yml on shehuphd/shiplock

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page