catopt-graph-graph-calculus.../README.md

80 lines
4.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CatOpt-Graph MVP
A minimal, Graph-Calculus-inspired orchestration studio for compositional optimization across edge meshes.
- Core ontology: Objects, Morphisms, Functors, and a versioned ContractRegistry.
- Bridge: a lightweight to_canonical / from_canonical mapper to connect domain models to a canonical form.
- ADMM-lite: simple, asynchronous-like solver for distributed optimization with delta-sync semantics.
- Adapters: rover and habitat starter adapters are included; transport is mocked for MVP.
- Governance: lightweight audit trail scaffolding.
How to run tests
- Ensure Python 3.10+ is installed
- Run: bash test.sh
Notes
- This MVP focuses on minimal, well-scoped components to enable end-to-end interoperability with adapters and the ADMM-lite solver.
- See core/bridge.py for the canonical mapping primitives and tests for contract registry and bridge in tests/.
## MVP Enhancements
- Added EnergiBridge: a minimal bridge to map domain LocalProblem representations to a canonical IR and back, enabling adapters to plug into the CatOpt-Graph core with a consistent interface.
- Exposed EnergiBridge in core as a convenient import (EnergiBridge).
- Added a minimal DSL sketch (docs/dsl_sketch.md) to seed adapters with canonical primitives.
- Introduced a lightweight Graph-of-Contracts scaffold and thread-safe contract registry improvements in core/core modules (see core/graph_of_contracts.py and core/contract_registry.py).
- Created READY_TO_PUBLISH baton for publishing readiness.
- Added a lightweight Graph-of-Contracts in core/graph_of_contracts.py to map adapters to versioned contracts.
- Added a minimal thread-safe enhancement to ContractRegistry (core/contracts.py) for concurrency safety.
- Added a minimal DSL sketch documenting the LocalProblem/SharedVariables/PlanDelta data contracts (docs/dsl_sketch.md).
- Added a minimal in-repo DSL documentation and a sample Graph-of-Contracts scaffold to accelerate adapter onboarding.
- Documentation and a ready-to-publish readiness baton in READY_TO_PUBLISH (to signal MVP stability when publishing).
CatOpt-Graph MVP
=================
Overview
- CatOpt-Graph is a graph-calculus-inspired orchestration studio for compositional optimization across edge meshes. The MVP demonstrates core primitives (Objects, Morphisms, Functors), a versioned contract registry, a bridge layer for canonical data exchange, integral ADMM-lite solver, and plug-in adapters (rover and habitat).
How to run tests
- Install Python 3.10+. Then run:
- bash test.sh
- The test suite includes contract registry conformance, bridge round-trips, and ADMM-lite solver tests.
How to contribute
- Use the provided DAG of modules to extend adapters and add new ones.
- All changes should be backed by tests.
This repo ships a production-like MVP rather than a toy example. Expect incremental exposure of domain adapters and more rigorous conformance tests in future milestones.
## Migration and Evolution
- Contract migration: The contract registry now supports migrating a contract from an older version to a newer version. This enables adapters to evolve data schemas over time while marking the legacy version as migrated. The old version will have a migrated_to field pointing to the new version, and the new version will register its updated schema. This helps maintain backward-compatibility during MVP-driven evolution of the canonical IR.
## MVP Roadmap
- Phase 0: Core interop skeleton (12 weeks)
- Solidify Objects/Morphisms/Functors with a versioned ContractRegistry (already scaffolded).
- Ship DSL seeds: LocalProblem, SharedVariables, PlanDelta, DualVariables, PrivacyBudget, AuditLog, PolicyBlock.
- Implement two starter adapters (rover_planner, habitat_module) connected via TLS, plus a minimal ADMM-lite solver integration.
- Phase 1: Governance & identity (23 weeks)
- Lightweight governance ledger and per-message conformance checks.
- Identity layer (DID or short-lived certs) for adapters and channels.
- Hardened contract conformance tests and deterministic replay on islanding.
- Phase 2: Cross-domain demo (23 weeks)
- Simulated two-agent end-to-end demo with a toy energy/task-allocation objective.
- SDK bindings (Python/C++) for the GoC registry and EnergiBridge-like mappings.
- Publish a minimal, stable GoC registry surface for onboarding adapters.
- Phase 3: Hardware-in-the-loop (23 weeks)
- HIL demo with Gazebo/ROS integration, KPI dashboards for convergence and delta-sync latency.
- Documentation updates and a minimal DSL tutorial for rapid prototyping.
- Success metrics
- Convergence speed to near-optimal, plan optimality gap vs centralized baseline.
- Delta-sync latency and replay accuracy during islanding/recovery.
- Adapter conformance and overall interoperability scoring.
- Deliverable artifacts
- DSL sketch docs, toy adapters, EnergiBridge mapping examples, and a publish-ready README.
If helpful, I can draft concrete toy adapters and a minimal EnergiBridge mapping to accelerate first-to-MVP progress.