Explainable autonomous execution policy engine for ClawPolicy workflows
Project description
ClawPolicy
Explainable autonomous execution policy engine for low-touch, auditable agent execution
English (Primary) | Chinese (Simplified)
3.0.0 Highlights
- Policy lifecycle:
hint -> candidate -> confirmed -> suspended -> archived - Canonical local storage:
.clawpolicy/policy/ - Policy-first supervision CLI:
clawpolicy policy ... - Stable Python API for confirmation, policy storage, and Markdown conversion/export
- Optional Phase 3 extras remain available through
clawpolicy[phase3]
Installation
PyPI
python3 -m pip install clawpolicy
Optional Phase 3 extras:
python3 -m pip install "clawpolicy[phase3]"
Source checkout
git clone https://github.com/412984588/clawpolicy.git
cd clawpolicy
python3 -m pip install -e ".[dev]"
CLI Entry Points
clawpolicy: primary console entry pointpython -m clawpolicy: module entry point
Initialize policy memory and inspect the current lifecycle state:
clawpolicy init
clawpolicy analyze
clawpolicy policy status
clawpolicy policy recent
init provisions:
.clawpolicy/policy/rules.json.clawpolicy/policy/playbooks.json.clawpolicy/policy/policy_events.jsonl.clawpolicy/USER.md.clawpolicy/SOUL.md.clawpolicy/AGENTS.md
Low-frequency supervision commands:
clawpolicy policy status
clawpolicy policy recent
clawpolicy policy risky
clawpolicy policy suspended
python -m clawpolicy policy status
Public Python API
The lib package exposes the supported policy-facing surface:
from lib import (
ConfirmationAPI,
PolicyEvent,
PolicyStore,
Playbook,
Rule,
MarkdownToPolicyConverter,
PolicyToMarkdownExporter,
create_api,
)
ConfirmationAPI/create_api: runtime confirmation and feedback loop integrationPolicyStore: canonical policy asset persistenceRule,Playbook,PolicyEvent: public policy modelsMarkdownToPolicyConverter: convert Markdown memory into policy assetsPolicyToMarkdownExporter: export canonical policy assets back to Markdown
Verification
python3 -m pytest tests/ -v
python3 scripts/check_docs_consistency.py
python3 -m ruff check lib tests scripts
python3 -m clawpolicy policy status
clawpolicy policy status
Core Modules
lib/policy_models.py: canonicalRule,Playbook, andPolicyEventmodelslib/policy_store.py: canonicalPolicyStoreand policy asset persistencelib/policy_resolution.py: scope inference and precedence resolutionlib/confirmation.py: runtime truth loop, event recording, and feedback applicationlib/promotion.py: promotion gates forcandidate -> confirmedlib/demotion.py: suspension, reactivation, and archive gateslib/learner.py: weak-hint derivation and strong-evidence aggregationlib/api.py: stable confirmation API surfacelib/cli.py: initialization, status, supervision, export, and inspection commandslib/environment.py: interaction environmentState: State data class (17 dimensions)Action: Action data class (11 dimensions)
lib/contracts.py: single source of truth for state and action dimensions
Optional Phase 3 Modules
lib/distributed_trainer.pylib/hyperparameter_tuner.pylib/monitoring.pylib/performance_optimizer.py
Test Coverage
- Total Tests: 169
- Local Validation:
python3 -m pytest tests/ -v - Coverage Areas: policy lifecycle promotion and suspension, scope precedence, public surface hard cut, canonical policy storage, CLI supervision, confirmation policy, RL core, optional Phase 3 modules, and docs/contract drift guards
Release and Versioning
- Versioning: SemVer
- Current release line:
3.x - Release runbook:
RELEASING.md/RELEASING.zh-CN.md - Changelog:
CHANGELOG.md
Documentation
- Architecture:
docs/architecture.md - Reward model:
docs/reward-model.md - Configuration:
docs/configuration.md - Optional dependencies:
docs/phase3-optional-deps.md - Contributing:
CONTRIBUTING.md - Security:
SECURITY.md - Support:
SUPPORT.md
License
MIT
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 clawpolicy-3.0.0.tar.gz.
File metadata
- Download URL: clawpolicy-3.0.0.tar.gz
- Upload date:
- Size: 217.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26debecf0f522cebf719738f57a852ba5def6661ef625359ad5c64d93872661c
|
|
| MD5 |
9207a0a89cdab0f2686a32daa3fe3cdd
|
|
| BLAKE2b-256 |
68be9a88b50486dafe2b937455e2775c6f22d6f9801c8f1102fde0fef964df71
|
File details
Details for the file clawpolicy-3.0.0-py3-none-any.whl.
File metadata
- Download URL: clawpolicy-3.0.0-py3-none-any.whl
- Upload date:
- Size: 89.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8736ea114c930c4095450f1b92347fe34cf8e7fb369a7b870aacc6482c0a06a
|
|
| MD5 |
3ea44b55094c1f023684e51240f9e4d1
|
|
| BLAKE2b-256 |
286c5ebc52772793f0deda43387fd6596f6d9eff85f94c6feeb5be3e3ddc0f08
|