Metadata-Version: 2.5
Name: pluvy
Version: 0.0.1
Summary: Read-only, parser-backed engineering policy gate for Python, Go, Java, JavaScript and TypeScript
Project-URL: Homepage, https://sectrend-cn.github.io/pluvy/
Project-URL: Repository, https://github.com/sectrend-cn/pluvy
Project-URL: Documentation, https://github.com/sectrend-cn/pluvy/blob/main/docs/getting-started.md
Project-URL: Issues, https://github.com/sectrend-cn/pluvy/issues
License-Expression: MIT
License-File: LICENSE
Keywords: code-review,engineering-standards,policy,static-analysis,tree-sitter
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Requires-Dist: agent-client-protocol<0.13,>=0.12.1
Requires-Dist: mcp<2,>=1.26
Requires-Dist: pydantic<3,>=2.10
Requires-Dist: tree-sitter-go<0.26,>=0.25
Requires-Dist: tree-sitter-java<0.24,>=0.23
Requires-Dist: tree-sitter-javascript<0.26,>=0.25
Requires-Dist: tree-sitter-python<0.26,>=0.25
Requires-Dist: tree-sitter-typescript<0.24,>=0.23
Requires-Dist: tree-sitter<0.26,>=0.25
Description-Content-Type: text/markdown

# Pluvy

A read-only engineering policy gate for Python, Go, Java, JavaScript/JSX and
TypeScript/TSX. No run mode modifies, stashes, stages, restores, deletes or
rewrites source files, and no run mode changes Git configuration. The shared
policy is in [Engineering standards](docs/engineering-standards.md).

## Install

Python 3.12 or newer is required. Install the published command line with
`uv tool install pluvy` or `python -m pip install pluvy`, then run `pluvy --help`.

## Run

Develop from this checkout, then activate the created environment:

```sh
python -m pip install --no-cache-dir uv==0.8.22
uv sync --locked --group dev
. .venv/bin/activate
```

The repository development checks are listed in `AGENTS.md` and run in
[the engineering workflow](.github/workflows/engineering.yml).

Run from any directory:

```sh
pluvy --root /path/to/project --all
pluvy --root /path/to/project --base BASE_COMMIT --format json
pluvy --root /path/to/project --staged
```

`--all` reads all selected working files including Git-ignored ones. `--base`
compares a commit to the working tree including untracked sources. `--staged`
reads changed index blobs and the index policy, never unstaged contents. Git
modes require the repository root.

Build the image from this checkout:

```sh
docker build -t pluvy:0.1.0 .
```

Run a one-line full audit from a target repository containing
`.pluvy/pluvy.json`:

```sh
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/workspace:ro" pluvy:0.1.0 pluvy --all
```

The image installs the locked runtime dependencies and Git. It does not contain a
target policy or development tools. The mount is read-only, and the calling
user's UID/GID preserve Git ownership checks. `--base` and `--staged` need the
complete Git metadata mounted too.

## Policy

Every target repository owns and commits its `.pluvy/pluvy.json`
policy. Copy [the example policy](examples/.pluvy/pluvy.json) to that
path and adapt it; paths inside the policy are relative to the repository root.

`include` and `exclude` control global file selection. All checkers are enabled by
default, so specify `enabled` only when disabling one.

Exit codes: **0** pass or warnings only for the reported scope, **1** error
findings, **2** configuration, encoding, filesystem or Git failure.

Repeated conditional field copies are checked in every supported language through
[`structure.guarded_projection`](.agents/skills/pluvy/references/checkers/structure.guarded_projection.md);
it defaults to three distinct destination fields in one local cluster.

See [Checker configuration](docs/checker-configuration.md) for all options,
defaults, language coverage and third-party usage boundaries.

## Language and rule plugins

All languages share one tree-sitter context. Language plugins own identity,
suffixes and grammar interpretation; application composition owns required
coverage and rule selection. Rules implement `RuleBundle`, consume
`TreeContext` and declare `RuleRequirements`. See
[Plugin architecture](docs/plugin-architecture.md), with per-checker Java scope
and limits covered by [checker configuration](docs/checker-configuration.md).

## Integration

Agent review rules can own review guidelines and invoke a configured ACP agent.
Findings are submitted incrementally through registered MCP tools, with explicit
completion and small acknowledgements. See [Agent review](docs/agent-review.md).

Any CI system that can run this image integrates with the same commands, and this
repository runs the same engineering checks in GitHub Actions; see
[the engineering workflow](.github/workflows/engineering.yml).

To run the gate image in a container, see the [Run section](#run) above.

A pre-commit hook may run `uv run --no-sync pluvy --staged` after the policy
is committed. Install hooks explicitly; this tool never changes Git configuration.

## Documentation

[Engineering standards](docs/engineering-standards.md) is the shared policy.
For installation, configuration, daily runs, finding triage and per-task gating,
start with [Getting started](docs/getting-started.md).
