Publish Guardian
Pre-publish release governance as a CLI
- Pipeline stages
- 9
- Checklist items
- 45
- Policy profiles
- 4
- Lines
- 3,545
- Files
- 41
- Commits
- 6
Project brief
PrototypeProblem
Publishing a private repository is irreversible. A human skim is not enough to catch every secret, identity, or policy problem.
Outcome
Publish Guardian gates the release of private repositories to public OSS behind a mechanical secret/PII scan, an LLM review lane, a 45-item OSS checklist, and an exit-code-enforced approval gate. Nothing reaches a public remote unless every stage clears.
Evidence
- A strict approval gate refuses to proceed, by exit code, while anything still blocks.
- It is a single-author, 0.1.0 tool (3,545 lines across 41 files, six commits) built to demonstrate the pattern, not to claim scale.
- Four Zod-validated YAML profiles set path tiers, PII terms, author allow-lists, and required lanes per consuming org.
Key decisions
- Policy profile: Four Zod-validated YAML profiles set path tiers, PII terms, author allow-lists, and required lanes per consuming org.
- Mechanical scan: ripgrep, gitleaks, and a git-author check catch literal secrets and PII before anything is staged.
- LLM review lane: A resumed agent reviews the staged tree for positioning and wording that regex-based scanning misses.
- Approval gate: A strict profile refuses to approve, by exit code, while any block, checklist item, or lane remains open.
The pipeline
Once a repository goes public, a leaked secret or a real name in a commit cannot be recalled. I built Publish Guardian as a linear, gated pipeline: inventory, scan, stage, review, checklist, compliance, approve, export, each stage writing to one decision ledger.
The CLI runs a linear, gated pipeline from source repo to public remote, with a Cursor-SDK review lane as the one subsystem worth stepping through in detail.
- 01Initkit scaffold + chosen policy profile
- 02Inventorytier classification: never / dev / config / ship / unknown
- 03Scanripgrep PII + gitleaks + author allow-listexits on any block
- 04Stagecopy ship-tier paths to a clean treefail-soft post-stage hooks
- 05ReviewLLM agent lanes: PII, OSS wording, IP positioning
- 06Checklist45-item OSS maintainer checklist
- 07Complianceaggregated report mapped to the OpenSSF Best Practices Badge
- 08ApproveGatehuman sign-offrefuses, by exit code, while anything still blocks
- 09Exportorphan single-commit push, no original history carried
Mechanical scan
Mechanical detectors catch literal secrets and PII.
The review lane
- 1Lanes resolveGatePII, OSS wording, IP positioning
- 2Prompt builttemplate plus an inlined skill body
- 3Agent resumed or createdGatepersisted identity reused across batches
- 4Run streamed and awaitedsend, stream, wait for a result
- 5Findings parsed and mergedverdicts normalized and written into the decision ledger
- 6State and audit persistedagent identity, completed lanes, an append-only log
- 7Agent disposed, gate enforceddeterministic cleanup; approval requires every lane complete
A Cursor SDK agent reviews the staged tree for positioning wording that regexes miss.
Policy as code
What counts as publishable is one of four Zod-typed policy profiles, so the same CLI serves different consumers by swapping a profile.
The approval gate & export
A strict approval gate refuses to proceed by exit code while anything still blocks. It is a single-author 0.1.0 tool built to demonstrate the pattern, not to claim scale.
Cleared for export.
Portfolio graph
Maps how the work here connects. Open the Portfolio graph →
- Professional
- Personal
- Skill
- Writing