file_policy
Diff-scoped file policy runner for verification rule packs. One combined git changed-path pass, per-path read cache, TOML rule registry, JSON-lines violations, and exit codes for CI.
Rule pack corpora live in agent-standards (file_policy/rule_packs/) and are assembled into app repos as file-policy/packs/. This repo is the engine only.
Install
Engine development:
pip install -e ".[dev]"
App repos: commit file-policy/requirements.txt with file-policy==x.y.z. Release: push tag v* → GitHub Actions publishes to PyPI (repo secret PYPI_API_TOKEN). scripts/verify/file_policy.ps1 bootstraps .venv-file-policy.
pip install file-policy==0.1.0
One-time publish setup: PyPI account → API token → GitHub repo secret PYPI_API_TOKEN → push tag v0.1.0 (or next version). GitHub repo can stay private; the PyPI wheel is public and needs no install auth.
CLI
python -m file_policy run --repo ROOT --packs PACKS_DIR [--git-base BASE] [--scope changed|full] [--verbose]
python -m file_policy rule test SLUG --repo ROOT --packs PACKS_DIR
python -m file_policy rule new SLUG --packs PACKS_DIR [--kind per-file|multi-file]
Exit codes: 0 clean, 1 violations, 2 usage/config errors.
Rule pack layout
Each pack is a directory under PACKS_DIR (see agent-standards file_policy/rule_packs/<slug>/).
MDL (minimal data loading)
from file_policy import run_minimal_data_loading
violations = run_minimal_data_loading(repo_root, config_dict, git_base)
Tests
python -m pytest tests/ -q
Metadata
Release files for file-policy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| file_policy-0.1.0.tar.gz | 17.0 kB | Without provenance | Details for file_policy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| file_policy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for file_policy-0.1.0-py3-none-any.whl |
Total release size: 37.8 kB
Release files / file_policy-0.1.0.tar.gz
| Download URL | file_policy-0.1.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5b3a8080aeb21740218a74f1dd32ede1f8bff20213432a0777b98b686aa41ce
|
|
BLAKE2b-256 checksum How to use checksums |
24e290e1b60a4454af5aebfc9881f7ae4c07ac101ead4c5c20b0758756cbb7d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / file_policy-0.1.0-py3-none-any.whl
| Download URL | file_policy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d77c12ef5074a0781bee95b8ef9792e25e2c2acd03103b0ec1877e196e5e2a9
|
|
BLAKE2b-256 checksum How to use checksums |
924c4411b287c2aaa350f0c1f95d8348290be47262ee898971d4446f9b40d252
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for file-policy 0.1.0
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.