op3 — Layered Operations Tree
AI Cost Tracking
- 🤖 LLM usage: $1.7164 (28 commits)
- 👤 Human dev: ~$1853 (18.5h @ $100/h, 30min dedup)
Generated on 2026-09-13 using openrouter/qwen/qwen3-coder-next
Layered infrastructure observation: observe, diff, orchestrate infrastructure as data.
Overview
op3 provides a unified framework for observing hierarchical infrastructure state across multiple layers:
- Physical Layer: Hardware, displays, network, compute
- OS Layer: Kernel, configuration
- Runtime Layer: Containers, compositor
- Service Layer: Containers, systemd services
- Endpoint Layer: HTTP endpoints, TCP ports
- Business Layer: Application health, business logic
Built on fraq's fractal data primitives, op3 enables:
- Deterministic layer scanning with probe system
- Format adapters (LESS, migration.yaml, snapshot.yaml)
- Drift detection between intended and actual state
- Immutable snapshots with diff capabilities
Installation
pip install op3
Quick Start
from opstree import LayerTree, LinearScanner, scan_device
from opstree.layers.builtin import PhysicalLayer, OsLayer, RuntimeLayer
# Register layers
tree = LayerTree()
tree.register(PhysicalLayer.display)
tree.register(OsLayer.kernel)
tree.register(RuntimeLayer.container)
# Scan a device
def execute(cmd: str):
# Your SSH/local execution logic
stdout, stderr, rc = ...
return stdout, stderr, rc
snapshot = scan_device("pi@192.168.188.109", execute, tree)
print(snapshot.to_yaml())
Format Adapters
from opstree.formats.less import LessAdapter
adapter = LessAdapter()
# Parse LESS to PartialSnapshot
partial = adapter.parse(open("app.doql.less").read())
# Render Snapshot to LESS
less_output = adapter.render(snapshot)
Project Status
Sprint 4 Complete (2026-04-21)
- ✅ Fixed datetime deprecation warnings (datetime.utcnow() → datetime.now(timezone.utc))
- ✅ All 26 tests passing with zero warnings
Sprint 5 Complete (2026-04-21)
- ✅ Added business.health builtin probe
- ✅ Added CLI layer filtering option (--layers flag)
Sprint 6 Complete (2026-04-21)
- ✅ Tested op3 with real-world examples from fraq, redeploy, doql
- ✅ Created examples/ folder with app.doql.less files from all three projects
- ✅ Enhanced CLI convert command to handle migration.yaml format
- ✅ All 26 tests passing
Sprint 3 Complete (2026-04-21)
- ✅ CLI with scan, drift, and convert commands
- ✅ Builtin probes (service.containers, endpoint.http)
- ✅ Format conversion between LESS, migration.yaml, snapshot.yaml
- ✅ CLI integration tested
Sprint 2 Complete (2026-04-21)
- ✅ Probe contexts (SSH, Local, Mock)
- ✅ Builtin probes (RPi display, Linux OS, container runtime)
- ✅ Format adapters (migration.yaml, snapshot.yaml)
- ✅ Integration tests with mock context (2 passing)
- ✅ ExecuteResult handling for compatibility
Sprint 1 Complete (2026-04-21)
- ✅ Layer tree with topological ordering
- ✅ Builtin layer definitions
- ✅ Snapshot model with Pydantic
- ✅ Probe protocol and registry
- ✅ Linear scanner
- ✅ Format registry (wraps fraq)
- ✅ LESS format adapter
- ✅ Unit tests (16 passing)
Dependencies
- fraq >= 0.2.15 (core primitives: FraqNode, FormatRegistry, adapters)
- pydantic >= 2.0
- pyyaml >= 6.0
- click >= 8.0
- jmespath >= 1.0
- rich >= 13.0
License
Licensed under Apache-2.0.
Status
Last updated by taskill at 2026-04-25 13:41 UTC
| Metric | Value |
|---|---|
| HEAD | c33adc1 |
| Coverage | — |
| Failing tests | — |
| Commits in last cycle | 20 |
Documentation and tooling were expanded: changelog generation, markdown output and formatting, a configuration management system, and a code analysis/relationship mapping engine were added. Tests and CLI were adjusted and some refactorings performed.
Dependency maintenance
See internal dependency updates for daily updates, locked tests and Python support.
Metadata
Release files for op3 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| op3-0.2.7.tar.gz | 526.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| op3-0.2.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 595.2 kB
Release files / op3-0.2.7.tar.gz
| Download URL | op3-0.2.7.tar.gz |
|---|---|
| Size | 526.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96aba93d169602ffae52a2bdcbec86a4713292d763b280850c45c18e938a7067
|
|
BLAKE2b-256 checksum How to use checksums |
2f4c6f098ec31587b4aaec1fc8a74b7afac09f5be2cddcde2e6283ce7b4f92cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / op3-0.2.7-py3-none-any.whl
| Download URL | op3-0.2.7-py3-none-any.whl |
|---|---|
| Size | 68.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b6ef9afa55c3d5ba12ff3b93a5bafbcf7d9e5564fae2a61ff82690628276b9a
|
|
BLAKE2b-256 checksum How to use checksums |
c10aee55764549a22489acd855c3b0a5f1bb91b4ddabeacdf4e6010944c72dd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|