Rules Engine for Forge — context-aware rule packs with conflict resolution and scope intersection detection.
Project description
forge-rules
Rules Engine for Forge — context-aware rule packs with fixed-lattice conflict resolution and scope intersection detection at lint time.
Features
- Fixed lattice:
deny > require > suggest(non-configurable inter-category precedence) - Intra-category strategies:
MOST_SPECIFIC_WINS(default) andPRIORITY_FIRST_MATCH(opt-in) - Scope intersection detection: lint-time detection of overlapping glob patterns (original contribution)
- YAML authoring: human-friendly rule pack format with round-trip support
- A2A/EventBus integration: emits
CONTEXT_INJECTEDevents for KPI tracking - CLI:
forge rules validate,lint,explain,diff
Quick start
from forge_rules import RulesEngine, load_yaml
engine = RulesEngine()
engine.load_yaml("rules/python-safety.yaml")
selection = engine.select(path="src/api/views.py", intent="code_review")
context_block = await engine.inject(selection, run_id="run-001")
Part of Forge
This package is part of Forge — the universal AI agent harness.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forge_rules-0.2.0.tar.gz.
File metadata
- Download URL: forge_rules-0.2.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b64c7ded6421c4566565a55a9ac7dc6703bca10007084ed7f6476cc2c9964542
|
|
| MD5 |
4361df135f0e21d6a68e9cc010e5e1c5
|
|
| BLAKE2b-256 |
714752ee1b0c8571c25a6722832c239d3cd876d2032112dd79fb4d32d765dac4
|
File details
Details for the file forge_rules-0.2.0-py3-none-any.whl.
File metadata
- Download URL: forge_rules-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d4de3957aabe8f1215be3d4ef23fb9b6cfcd1eeb0af7f6c652a235e657080b7
|
|
| MD5 |
aac33c68ba031081a1e093749c013b90
|
|
| BLAKE2b-256 |
b6175633448fae3b0f3557e08c18453d5f6a2d9866915e71b3a7bc69049761fb
|