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. --deadline UNIX_TIME is when the caller gives up (a hook that kills the command at a timeout passes it): the check counts its budget from its own start and answers a second before the earlier of the two, so a loaded machine gets a verdict instead of a killed process. A check that ran out of time, or took over 3 s, logs what each lookup cost (slow_check, program names and seconds only).
  • 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.

Sweep: audit what is already published

check judges one text before it goes out. sweep asks of what already went out: which texts would be flagged now?

public-text-guard sweep --owner octo --since 2026-11-21 --until 2026-11-25 --author octocat --out sweep-out
# one JSON line of counts by category; units.jsonl and hits.jsonl in sweep-out/

It gathers every issue and PR the owners' accounts created or updated in the window (gh search, split by day and throttled, one GraphQL query per item for the body, comments, reviews, review comments and PR commit messages), keeps the author's texts created in the window in public repos, and scans each with check. Every response is cached under --out/cache, so a run stopped by a rate limit resumes. hits.jsonl holds categories, credential rule names, the URL and a hash of the text, never the text or a matched term. It also flags any user's home path (/Users/<anyone>, /home/<anyone>, /root/...), and hides commit SHAs and pass: tests-style prose from the credential shape. It needs the gh CLI, logged in. Rewording flagged texts in place is not part of it: a real credential is a rotation, never an edit. --out holds copies of public texts; keep it out of version control.

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

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.6
File Size Uploaded Provenance Actions
pubcheck-0.0.6.tar.gz 44.5 kB Without provenance Details for pubcheck-0.0.6.tar.gz

Built distribution (wheel)

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

Total release size: 83.3 kB

Release files / pubcheck-0.0.6.tar.gz

Download URL pubcheck-0.0.6.tar.gz
Size 44.5 kB
Tags Source
SHA-256 checksum
How to use checksums
312b811c1f71723fd3c88de8491c188bb50bacc8c0cc3bfd58dad3ea591cba37
BLAKE2b-256 checksum
How to use checksums
a41aa35c86d2734fed6262982167b5e22f99b92c152b510077a1ea1da66e45cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","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.6-py3-none-any.whl

Download URL pubcheck-0.0.6-py3-none-any.whl
Size 38.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f74c462e292ad965bbe5ba78514e2420ff58ff9ecdaf20633f99557268c20083
BLAKE2b-256 checksum
How to use checksums
e7f0a2d8003fb93b47c5e63ff80cb62dbb27d8b29dff5ed1c7dd332e356712f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","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.6

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