Skip to main content

pubcheck

One publication check for every writer: is this text fit for the repository it is about to be published to?

pip install pubcheck
printf '%s' "$BODY" | public-text-guard check --repo octo/app --unattended
# exit 0 pass, 1 flag, 2 unavailable; one JSON line naming the categories, never the text
from pubcheck import check

v = check("As the owner asked, we fixed it.", repo="octo/app")
v.decision, v.categories  # ('flag', ['owner-relation'])

A private target passes untouched. A public one, or one whose visibility is unknown, is scanned for:

  • registry: names from the owner's acquaint records that a public reader may not see (acquaint disclosure --audience '{"scope": "public"}');
  • owner-relation: the owner's own preferences, corrections or relations ("the operator stated", "my agents");
  • private-ref: repos known to be private, private companions, this machine's home folder, and your own private_patterns;
  • session-link: Claude session links;
  • credential: credential-shaped strings (the patterns of openloops.egress);
  • mention: @login and @org/team outside code, for an unattended writer only, since a mention notifies a person.

Attended and unattended writers

An attended writer (an agent session someone is driving) proceeds without the registry when acquaint cannot be asked, and the gap is logged. An unattended writer (a connector, a scheduled job, anything that posts with nobody reading first) fails closed: a missing registry, a lookup out of time or any error is unavailable (exit 2), and the text must be held, never posted.

Three ways in, one check

  • Python: pubcheck.check(text, repo=..., title=..., unattended=...) returns a Verdict.
  • CLI: public-text-guard check --repo OWNER/REPO [--unattended] [--title T] [--hold TARGET] [--terms], the text on stdin. --terms adds the matched terms, for a local author who has to reword; --hold files a held post as a desk item.
  • correspond: at the top of ~/.config/correspond/config.toml, before_send = "pubcheck.correspond:before_send". Every write to a public audience is checked unattended; a held one raises correspond's NeedsApproval with the categories, and on a real send (not a dry run) becomes a desk item.

Held posts become desk items

With hold_repo set, a held post is filed as an issue in that private repo with the label the desk reads (hold_label, default escalate): the target, the title, the text (credential-shaped strings redacted) and the categories, so it can be published as is, edited or dropped. The hold repo's visibility is asked of GitHub just before filing, and nothing is copied to a repo that is not private. The same text held twice is filed once. With no hold_repo, the post is still held; only the desk item is missing.

Settings

~/.config/pubcheck/config.toml ($PUBCHECK_CONFIG names another file), then environment variables, then keyword arguments:

key env default
hold_repo PUBCHECK_HOLD_REPO unset (no desk item)
hold_label PUBCHECK_HOLD_LABEL escalate
budget_seconds PUBCHECK_BUDGET_SECONDS 12
private_owner PUBCHECK_PRIVATE_OWNER unset: the account whose <owner>/_<name> repos are private companions
private_issues PUBCHECK_PRIVATE_ISSUES unset: where context with no companion goes
private_patterns (config only) none: regexes for private references, such as working folders

Caches and log

Visibility comes from a cache shared with other tools (~/.cache/priv/repo_visibility/), then gh repo view. The vocabulary is cached an hour in ~/.cache/public-text-guard/. Decisions worth keeping go to ~/.local/state/public-text-guard/events.jsonl (mode 0600): categories, repo, writer, a short hash of the text, an error's type and an override's reason; never the text or the matched terms.

System requirements

gh (authenticated) for visibility lookups and desk items; acquaint for the registry. Without gh, visibility is unknown and so public; without acquaint, an unattended check is unavailable.

Metadata

Release files for pubcheck 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pubcheck 0.0.2
File Size Uploaded Provenance Actions
pubcheck-0.0.2.tar.gz 27.1 kB Without provenance Details for pubcheck-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pubcheck 0.0.2
File Interpreter ABI Platform Actions
pubcheck-0.0.2-py3-none-any.whl Python 3 none any Details for pubcheck-0.0.2-py3-none-any.whl

Total release size: 52.8 kB

Release files / pubcheck-0.0.2.tar.gz

Download URL pubcheck-0.0.2.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
496cdf9de0831a327532f6906ebbca23c2e932bcf74454f195863e2e787c8725
BLAKE2b-256 checksum
How to use checksums
3157dccf207c7b4dea524d4a2acd2fe6415c48dabc4aefe782ee2b5399ced0ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pubcheck-0.0.2-py3-none-any.whl

Download URL pubcheck-0.0.2-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e430ffa9d5b874937984642bd89d29331b94fbd8ef3aa2b3117ac85724eee289
BLAKE2b-256 checksum
How to use checksums
2fb32bba9daef125255f045cc2b9865c9bc7a5c9977863236f69d028d5ee549a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pubcheck 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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