compose-lens 0.1.2

Loss-aware parsing, processing, validation, and rendering of Compose projects
Documentation

ComposeLens

ComposeLens is a Rust library for reading, understanding, transforming, validating, and rendering real-world Compose documents.

It is designed for tools that need more than strict deserialization: source-aware diagnostics, implementation extensions, optional interpolation, multi-file projects, profiles, and round-trip-safe transformations.

Goals

  • Parse Compose YAML without forcing immediate normalization or interpolation.
  • Represent syntax, typed Compose concepts, extensions, and unknown fields explicitly.
  • Preserve field-specific short and long syntax when their defaults or runtime behavior can differ.
  • Preserve enough source information for actionable diagnostics and safe editing.
  • Support multi-file project loading, merging, profile selection, and configurable interpolation.
  • Model behavior found in real Docker Compose and Podman Compose projects.
  • Render deterministic Compose documents.
  • Allow callers to choose strict, implementation-specific, or tolerant validation profiles.

Non-goals

  • Running a Compose project
  • Reimplementing Docker or Podman
  • Converting Compose directly to Quadlet or Kubernetes
  • Enforcing OCI rules that real Compose implementations do not enforce
  • Treating the Compose Specification as the only source of real-world behavior

Cross-format conversion belongs to BoxFerry. Quadlet handling belongs to QuadletLens.

Processing levels

source text
  → loss-aware syntax document
  → typed Compose document
  → loaded multi-file project
  → optional per-file interpolation
  → provenance-preserving merged project
  → optional profile selection and native project view
  → references, paths, defaults, and compatibility
  → validated semantic view
  → rendered Compose document

Callers may stop at any appropriate level. Parsing a document must not implicitly read environment variables or contact a runtime.

Documentation

Repository-specific guidance for coding agents is in AGENTS.md.

Origin

ComposeLens is implemented from scratch. It is not a fork of compose_spec_rs and does not copy or mechanically translate its source code.

Stewardship

ComposeLens is created and maintained by Martin “Becks” Beckert through Strukturpiloten OHG. The project is part of Strukturpiloten's work on open, maintainable, and portable container infrastructure.

License

ComposeLens is licensed under the Mozilla Public License 2.0.