Platform engineer & builder

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

Prototype

Problem

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.

The pre-publish governance pipeline
  1. 01Initkit scaffold + chosen policy profile
  2. 02Inventorytier classification: never / dev / config / ship / unknown
  3. 03Scanripgrep PII + gitleaks + author allow-listexits on any block
  4. 04Stagecopy ship-tier paths to a clean treefail-soft post-stage hooks
  5. 05ReviewLLM agent lanes: PII, OSS wording, IP positioning
  6. 06Checklist45-item OSS maintainer checklist
  7. 07Complianceaggregated report mapped to the OpenSSF Best Practices Badge
  8. 08ApproveGatehuman sign-offrefuses, by exit code, while anything still blocks
  9. 09Exportorphan single-commit push, no original history carried
A private repo and a chosen policy profile pass through nine gated stages before anything reaches a public remote.

Mechanical scan

Mechanical detectors catch literal secrets and PII.

Mechanical scanripgrep, gitleaks, and a git-author check catch literal secrets and PII before anything is staged.

The review lane

The review-lane subsystem
  1. 1Lanes resolveGatePII, OSS wording, IP positioning
  2. 2Prompt builttemplate plus an inlined skill body
  3. 3Agent resumed or createdGatepersisted identity reused across batches
  4. 4Run streamed and awaitedsend, stream, wait for a result
  5. 5Findings parsed and mergedverdicts normalized and written into the decision ledger
  6. 6State and audit persistedagent identity, completed lanes, an append-only log
  7. 7Agent disposed, gate enforceddeterministic cleanup; approval requires every lane complete
Each review batch resumes a persisted agent identity, streams a lane-specific prompt, and merges normalized verdicts into the same decision ledger before the agent is disposed.

A Cursor SDK agent reviews the staged tree for positioning wording that regexes miss.

LLM review laneA resumed agent reviews the staged tree for positioning and wording that regex-based scanning misses.

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.

Policy profileFour Zod-validated YAML profiles set path tiers, PII terms, author allow-lists, and required lanes per consuming org.

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.

Approval gateA strict profile refuses to approve, by exit code, while any block, checklist item, or lane remains open.
ExportPublication happens as a single orphan commit that carries none of the original git history.

Cleared for export.

Portfolio graph

Hover nodes · click empty canvas to zoom/pan

Maps how the work here connects. Open the Portfolio graph →

  • Professional
  • Personal
  • Skill
  • Writing