HarperZ9/public-surface-sweeperExplainer, built from commit 51eccfbAll repository explainers

Public Surface Sweeper

Check a repository's public surface before it asks anyone to trust it.

What it does for you

Small public repositories fail on simple things: a missing license, a README that does not say what the tool does, a credential-shaped string left in a note. Public Surface Sweeper checks those quickly and the same way every time, scores the repository, lists what to fix, and can scan every GitHub-facing repository in a workspace at once.

Source: README.md at 51eccfb (version 0.1.3)

Watch

No concept film fits this tool closely yet. The walkthrough below covers it in text, with real commands and output.

Video walkthrough: coming with the next release.

How it works, one step at a time

Scroll, or use the step buttons. The panel uses the bundled examples/clean-repo and a copy of it with two problems added. Every line is output from public-surface-sweeper at commit 51eccfb.

  1. 01

    A clean repository

    The bundled fixture has the files a public repository should carry: a license, a README, a usage guide, a changelog, contributing notes, an authors file, agent instructions and a CI folder. The sweep finds nothing, scores 100 and reports ready.

    Source: examples/clean-repo; README.md, "Try it"

  2. 02

    Break it twice

    Copy the fixture, delete its LICENSE, and add a note holding a value shaped like an AWS access key: AKIA followed by sixteen capitals. Sweep again. Both are errors, each with where it is.

    Source: src/public_surface_sweeper/sweeper.py, src/public_surface_sweeper/text_hygiene.py

  3. 03

    A score and a list of fixes

    --summary turns the findings into a score, a status and one action item per finding. Two errors take the score to 50 and the status to blocked.

    Source: src/public_surface_sweeper/summary.py

  4. 04

    Evidence for the next tool

    --proof-packet writes a proof-surface packet. Its claims carry the counts behind each check: one required-file finding, one secret-shaped finding, no em-dash findings, no delivery findings. The check reads fail at score 50.

    Source: src/public_surface_sweeper/cli.py

  5. 05

    Choose what fails the run

    By default the run exits 1 on errors. --fail-on warning fails on warnings too, and --fail-on none prints findings and always exits 0. In workspace mode, a discovery that finds no repositories also fails, so an empty matrix never passes as a clean one.

    Source: README.md, "Usage"

Walkthrough

Install it, run it once, then use the main feature. Each command below is real, and so is its output.

  1. Install

    Install from a checkout. Python 3.10 or newer.

    $ git clone https://github.com/HarperZ9/public-surface-sweeper && cd public-surface-sweeper
    $ python -m pip install -e ".[test]"
  2. First run: a clean repository

    Sweep the bundled clean example.

    $ public-surface-sweeper examples/clean-repo --summary
    score: 100
    status: ready
    total_findings: 0
    errors: 0
    warnings: 0
    action_items:
    - none
  3. A repository with a problem

    Sweep a repository that carries a finding. The sweep blocks it.

    $ public-surface-sweeper ./repo
    ERROR LICENSE required-file: missing required file: LICENSE
    ERROR notes.txt:1 aws-access-key: AWS access key shaped value
  4. A proof packet

    Write the result as a packet another tool can check.

    $ public-surface-sweeper ./repo --proof-packet
    "surface": "repo public release surface"
    "status": "blocked"
    Required public release files are visible.   required-file findings=1
    Secret-shaped values are surfaced before publication.   secret-shaped findings=1
    Public text hygiene is checkable.   em-dash findings=0
    Public and developer delivery are inspectable.   delivery findings=0
    check: public-surface-sweeper  fail  score=50, findings=2

Output from public-surface-sweeper at 51eccfb on Windows with Python 3.12. The broken copy deletes LICENSE and adds one note.

What it does not do

Source: README.md at 51eccfb, "Current status" and "Usage"

Check what stuck

Answer each one in your head before you open it.

What two findings did the broken copy get?

A missing LICENSE and an AWS-access-key-shaped value in notes.txt, line 1.

What score and status follow from two errors?

50 and blocked.

Why does an empty workspace discovery fail?

So a matrix of zero repositories never passes as a clean portfolio.