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), plus what an external secret scanner finds when you set credential_scanner;
  • 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
credential_scanner PUBCHECK_CREDENTIAL_SCANNER unset: a gitleaks-compatible scanner to run beside the built-in patterns, e.g. betterleaks

credential_scanner adds the long tail of vendor key formats (betterleaks ships several hundred rules) to the built-in patterns, which stay. The text is piped to <scanner> stdin with the report redacted, and live validation is never requested, since checking whether a key works means sending it to its vendor. It runs once per check over the whole post, from a neutral folder, and only from an absolute path outside the current folder. A scanner that is missing or fails is logged as a gap: an attended check carries on with the built-in patterns (and says so once on stderr), an unattended one is unavailable and holds the text. A held post whose credential only the scanner found is filed without its text, since the redaction patterns cannot find that credential. credential_scanner_args (config only) replaces the argument list for a scanner whose flags differ.

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.3

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.3
File Size Uploaded Provenance Actions
pubcheck-0.0.3.tar.gz 31.2 kB Without provenance Details for pubcheck-0.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 59.7 kB

Release files / pubcheck-0.0.3.tar.gz

Download URL pubcheck-0.0.3.tar.gz
Size 31.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8e37dde211b8674cff4eb1585cf1b22f9f8d371a5df87eed6a2f41763ecb5ddb
BLAKE2b-256 checksum
How to use checksums
e7b927faef6d93814f7f5669dfabe9dcc166183657b571722eea2c0071959dfa
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.3-py3-none-any.whl

Download URL pubcheck-0.0.3-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7542a1b971451b66b6c0860248bebc176b3b8091f3433351c4394f82d5631a91
BLAKE2b-256 checksum
How to use checksums
e44eaf9dcdd4c13ca788844f62657c2818ad00256701758c7598401115476023
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.3

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