Skip to main content

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) and PRIORITY_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_INJECTED events 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.

Metadata

Release files for forge-rules 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forge-rules 0.2.0
File Size Uploaded
forge_rules-0.2.0.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for forge-rules 0.2.0
File Interpreter ABI Platform
forge_rules-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / forge_rules-0.2.0.tar.gz

Download URL forge_rules-0.2.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b64c7ded6421c4566565a55a9ac7dc6703bca10007084ed7f6476cc2c9964542
BLAKE2b-256 checksum
How to use checksums
714752ee1b0c8571c25a6722832c239d3cd876d2032112dd79fb4d32d765dac4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / forge_rules-0.2.0-py3-none-any.whl

Download URL forge_rules-0.2.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d4de3957aabe8f1215be3d4ef23fb9b6cfcd1eeb0af7f6c652a235e657080b7
BLAKE2b-256 checksum
How to use checksums
b6175633448fae3b0f3557e08c18453d5f6a2d9866915e71b3a7bc69049761fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page