Skip to content

feat(config): add core component config engine#202

Open
maxxgx wants to merge 2 commits into
mainfrom
max/comp-config-1-core
Open

feat(config): add core component config engine#202
maxxgx wants to merge 2 commits into
mainfrom
max/comp-config-1-core

Conversation

@maxxgx

@maxxgx maxxgx commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduces physicalai.config (@export_config, to_config, instantiate, normalization, envelope validation, cycle detection).
  • Consolidates dotted-path importing under physicalai.config.importing; inference and robot transport re-export from there.
  • Updates docs/reference/config-schema.md and adds unit tests under tests/unit/config/.

Test plan

  • uv run pytest tests/unit/config/

Review & merge order

  1. PR #202 — Core config engine (this PR)main
    Core physicalai.config (export, instantiate, validation)

  2. PR #204 — Robot drivers & SharedRobot transport
    Robot config export and SharedRobot owner process startup

  3. PR #205 — Camera drivers & SharedCamera transport
    Camera config export and SharedCamera publisher startup

  4. PR #206 — Runtime, InferenceModel & CLI
    End-to-end YAML, physicalai run --config, examples, and user docs

In parallel: PR #203 — Component config design docdocs/design
Detailed design doc; not blocking the code PRs

Introduce physicalai.config with export_config, to_config, instantiate,
normalization, envelope validation, and consolidated dotted-path importing.
Refactor inference and robot transport importers to delegate to the shared
module.

Co-authored-by: Cursor <cursoragent@cursor.com>
@maxxgx
maxxgx requested a review from a team as a code owner July 27, 2026 10:00
Copilot AI review requested due to automatic review settings July 27, 2026 10:00
@maxxgx
maxxgx requested a review from a team as a code owner July 27, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new physicalai.config module that defines a strict, JSON-shaped component configuration format (class_path + init_args) along with utilities to export live components to config, validate/normalize configs, and instantiate trusted config trees. This centralizes dotted-path importing and updates documentation/tests to align Runtime configuration with the new core config engine.

Changes:

  • Introduces physicalai.config public API (@export_config, to_config, instantiate, validation/normalization, YAML helpers, envelope validation).
  • Consolidates dotted-path importing into physicalai.config.importing and re-exports it from inference and robot transport for backward compatibility.
  • Updates the config schema reference docs and adds substantial unit test coverage for export/normalize/instantiate/YAML round-trips.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/config/init.py Marks the new config unit test package and sets ruff ignores.
tests/unit/config/test_component_config.py Comprehensive tests for export/normalize/instantiate behavior, including error paths and depth/cycle guards.
tests/unit/config/test_yaml.py Tests YAML serialization/deserialization round-trips for exported components/config mappings.
src/physicalai/config/init.py Defines the public physicalai.config API surface and re-exports key functions/types.
src/physicalai/config/_envelope.py Adds schema-positive envelope validation and component-config normalization for transports.
src/physicalai/config/_errors.py Introduces config-specific error types (ComponentConfigError, ComponentImportError).
src/physicalai/config/_export.py Implements @export_config, captured init-arg export via to_config, and class_path resolution.
src/physicalai/config/_instantiate.py Implements trusted config preflight validation and recursive instantiation.
src/physicalai/config/_normalize.py Implements recursive normalization, cycle/depth detection, and config-shape validation.
src/physicalai/config/_path.py Adds shared path formatting helper for consistent error messages.
src/physicalai/config/_types.py Defines core JSON/config TypedDicts and internal constants (depth limit, private attrs).
src/physicalai/config/_yaml.py Adds YAML serialization/loading helpers for component configs.
src/physicalai/config/importing.py New canonical dotted-path import helper used across config/inference/robot.
src/physicalai/inference/_importing.py Re-exports canonical import_dotted_path for backward compatibility.
src/physicalai/robot/transport/_importing.py Re-exports canonical import_dotted_path for backward compatibility.
docs/reference/config-schema.md Updates documentation to describe the strict ComponentConfig schema and Runtime document shapes.

Comment thread src/physicalai/config/_envelope.py
Comment thread src/physicalai/config/importing.py
Comment thread src/physicalai/config/_yaml.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants