Power2Idea AI

Apple Policy Lint (Swift AST) — now on GitHub Marketplace

Deterministic Swift AST policy checks as a GitHub Action: clean PR reports, baseline-first onboarding, and early enforcement before App Store review.

Sun Jan 18 2026 • Code Compliance, Policy-as-code, Swift, AST, GitHub Actions, Privacy Manifest

Marketplace release

Apple Policy Lint is now published on GitHub Marketplace.

It turns policy requirements into deterministic, reviewable PR checks — enforced early, when fixes are cheap.

If you want the fastest onboarding path, use the customer pack templates:

  • baseline workflow (one-time)
  • PR enforcement workflow (diff + only-new)
  • .p2i/config.json

What it does

  • Parses Swift using a real AST (tree-sitter), not regex
  • Detects policy-sensitive API usage (e.g., Apple Required Reason APIs)
  • Posts a clean PR report with file/line + remediation guidance
  • Optionally fails the workflow to gate merges

This is designed as a code compliance wedge: enforce the policy early in the engineering lifecycle. Swift is the first target; the model is language-agnostic.


Recommended onboarding flow

0) Enable workflow permissions (required for baseline PR)

Repo → Settings → Actions → General

  • Workflow permissions: Read and write
  • ✅ Allow GitHub Actions to create and approve pull requests

1) Add config

Create .p2i/config.json:

{
  "ignore_paths": [".git",".github","Pods","Carthage",".build","build","DerivedData","vendor"],
  "ignore_rules": []
}

2) Generate baseline (one-time)

Run the baseline workflow (workflow_dispatch). It creates a PR that writes .p2i/baseline.json. Merge it.

3) Enforce on PRs (diff + only-new)

PR lint runs on changed Swift files and fails only for findings not present in baseline.

How it works

Apple Policy Lint (Swift AST) — now on GitHub Marketplace — architecture diagram 1
Deterministic Swift AST policy checks as a GitHub Action: clean PR reports, baseline-first onboarding, and early enforcement before App Store review.
Mermaid source
flowchart LR\n  A[PR opened] --> B[GitHub Action]\n  B --> C[Parse Swift AST]\n  C --> D[Policy rulepack]\n  D --> E[PR report]\n  E -->|fail| F[PR blocked]\n  E -->|pass| G[Merge]

Code compliance direction

Power2Idea AI is building a code compliance company:

  • deterministic enforcement first (no AI in the merge gate)
  • clean evidence artifacts (PR reports)
  • language-agnostic approach (Swift now; Rust/TypeScript next)
  • future support for enterprise platforms and additional ecosystems

Links