Metadata-Version: 2.4
Name: nrprotocol
Version: 1.0.1
Summary: NRP — Node Reach Protocol. AAP for the physical world.
License: MIT
Project-URL: Homepage, https://nrprotocol.dev
Project-URL: Repository, https://github.com/halyndev/nrprotocol
Keywords: nrp,aap,physical,robot,iot,protocol,ai,safety
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aap-protocol>=0.1.0
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Dynamic: license-file

# NRP — Node Reach Protocol

**AAP for the physical world.**

[![pypi](https://img.shields.io/badge/pypi-nrprotocol-orange)](https://pypi.org/project/nrprotocol/)
[![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![tests](https://img.shields.io/badge/tests-22%2F22-brightgreen)](https://github.com/ElmadaniS/nrp)

```bash
pip install nrprotocol
```

NRP implements the AAP spec for physical nodes — robots, IoT sensors, industrial machines, drones, vehicles. 4 methods. Any device.

```python
from nrp import NRPDriver, NRPNode, NRPManifest, NRPAddress, ShieldRule, ShieldOperator

class RobotArm(NRPDriver):
    def manifest(self):
        return NRPManifest(
            address=NRPAddress.parse("nrp://factory-3/robot/arm-7"),
            description="6-DOF robot arm",
            version="1.0.0",
        )
    def observe(self): return {"x_mm": 142, "force_n": 0}
    def act(self, action, params): return {"ok": True}
    def shield_rules(self):
        return [
            ShieldRule("force_n", ShieldOperator.MAX, max_value=50.0),  # structural limit
            ShieldRule("z_mm",    ShieldOperator.MIN, min_value=0.0),   # no floor collision
        ]

node = NRPNode(RobotArm())
node.execute("grip", {"force_n": 80})  # ShieldViolation: 80N > 50N
node.execute("grip", {"force_n": 25})  # OK — recorded in audit chain
```

## Physical World Rule

Level 4 (Autonomous) is **forbidden by AAP spec** for physical nodes. NRP enforces this at the driver level. Not configurable. Not overridable. Returns **AAP-003**.

## Address format

```
nrp://factory-3/robot/arm-7
nrp://farm/sensor/soil-north
nrp://fleet/vehicle/truck-42
nrp://hospital/device/infusion-3
```

**[AAP Spec](https://aap-protocol.dev) · [Halyn](https://halyn.dev) · [nrprotocol.dev](https://nrprotocol.dev)**

License: MIT
