Skip to content

[Config json format consolidation] #4 Remove deprecated config fallbacks and bump schema to v2 - #60

Merged
Soham Das (SohamDas2021) merged 3 commits into
mainfrom
user/sodas/ConsolidateConfigParams_4
Mar 26, 2026
Merged

Soham Das (SohamDas2021) merged 3 commits into
mainfrom
user/sodas/ConsolidateConfigParams_4

Conversation

@SohamDas2021

Copy link
Copy Markdown
Contributor

Step 4 of multi-step consolidation process.

Removes all dual-read fallback code for legacy config fields (script, workingDirectory, top-level timeout, appContainer.name, lxc.containerName, lxc.destroyOnExit, clearPolicyOnExit, removeRulesOnExit, container alias). Process section is now required. Runners read from container_id and lifecycle instead of removed ContainerPolicy/LxcConfig fields. Bumps SUPPORTED_MAJOR_VERSION to 2. Schema renamed to v2.


PR 1 ✅ Merged

  • version, containerId, process section with dual-read fallback. Vm/MicroVm enum variants.
    Manual Default for CodexRequest.

PR 2 ✅ Merged

  • schemas/mxc-config.v1.schema.json. Schema version validation. idleTimeoutMs dual-read. containerId →
    app_container_name mapping. Migrate 15 examples + 16 test configs. Update docs/schema.md.

PR 3 ✅ Merged

  • Add LifecycleConfig struct. Parse lifecycle.destroyOnExit/preservePolicy with dual-read from legacy
    fields. wslc alias for container key. Update sdk/src/types.ts, cli/README.md, cli/ARCHITECTURE.md,
    sdk/README.md.

PR 4 🔄 In review -> This PR

  • Drop script, workingDirectory, top-level timeout, container alias, appContainer.name,
    lxc.containerName, lxc.destroyOnExit, clearPolicyOnExit, removeRulesOnExit from parser. Bump
    SUPPORTED_MAJOR_VERSION to 2.

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

Removes legacy/dual-read config parsing paths and completes the move to the consolidated v2 config format (with process required), updating runners to rely on container_id + lifecycle instead of deprecated per-backend/legacy fields.

Changes:

  • Removed deprecated config fields/fallbacks (script/workingDirectory/timeout/appContainer.name/lxc.containerName/etc.) and made process required; bumped supported schema major version to 2.
  • Updated runtime components (AppContainer/LXC runners, NetworkManager, models) to use container_id and lifecycle for naming and cleanup decisions.
  • Updated schema/docs/tests and test configs to reflect the v2 format and removed deprecated removeRulesOnExit fields.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test_configs/network_firewall_test.json Removes deprecated removeRulesOnExit from network config.
test_configs/network_default_test.json Removes deprecated removeRulesOnExit from network config.
test_configs/network_capabilities_test.json Removes deprecated removeRulesOnExit from network config.
test_configs/network_both_test.json Removes deprecated removeRulesOnExit from network config.
src/wxc_common/src/validator.rs Updates tests to use container_id instead of deprecated policy naming fields.
src/wxc_common/src/network_manager.rs Passes container name explicitly to proxy coordinator; stop_all now uses a cleanup boolean.
src/wxc_common/src/models.rs Removes deprecated fields from ContainerPolicy and LxcConfig; relies on LifecycleConfig for cleanup semantics.
src/wxc_common/src/config_parser.rs Removes legacy parsing fallbacks; requires process; bumps SUPPORTED_MAJOR_VERSION to 2; updates parser tests accordingly.
src/wxc_common/src/appcontainer.rs Derives effective container name from container_id; cleanup driven by lifecycle.preserve_policy.
src/wxc/src/main.rs Logs container name using container_id (fallback to “CLI”).
src/lxc_common/src/lxc_runner.rs Runner now takes container_id + lifecycle and uses them for naming/cleanup.
src/lxc/src/main.rs Wires lifecycle/container_id into LxcScriptRunner and logs container name from container_id.
schemas/mxc-config.v2.schema.json Updates schema $id and description to v2.
docs/schema.md Points to v2 schema and expands/updates schema versioning documentation for major-version compatibility.
Comments suppressed due to low confidence (1)

schemas/mxc-config.v2.schema.json:5

  • The v2 schema now positions itself as the canonical format, but the version property later in this schema still documents semver-style values (e.g. "0.1.0") and even has an unmatched quote in its description. This conflicts with the parser/docs, which require version to start with a positive integer major ("1", "2", or "2.x"), and will reject "0.3.0-alpha". Please update the schema’s version field description/examples/pattern accordingly so JSON Schema validation matches runtime behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 15 to +19
@@ -16,7 +16,6 @@
"defaultPolicy": "block",
"enforcementMode": "firewall",
"allowedHosts": [ "api.github.com" ],
"blockedHosts": [],
"removeRulesOnExit": true
"blockedHosts": []

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

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

This config still declares "version": "0.3.0-alpha" (top of file), which will now be rejected by validate_schema_version() because major version 0 is invalid (must be >= 1) and SUPPORTED_MAJOR_VERSION is 2. Please update this test config to use a supported major (e.g. "2") or omit version so it remains runnable.

Copilot uses AI. Check for mistakes.
Comment on lines 14 to +18
@@ -15,7 +15,6 @@
"network": {
"defaultPolicy": "block",
"allowedHosts": ["api.github.com"],
"blockedHosts": [],
"removeRulesOnExit": true
"blockedHosts": []

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

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

This config still declares "version": "0.3.0-alpha" (top of file), which will now be rejected by validate_schema_version() because major version 0 is invalid (must be >= 1) and SUPPORTED_MAJOR_VERSION is 2. Please update this test config to use a supported major (e.g. "2") or omit version so it remains runnable.

Copilot uses AI. Check for mistakes.
Comment on lines 15 to +19
@@ -16,7 +16,6 @@
"defaultPolicy": "block",
"enforcementMode": "capabilities",
"allowedHosts": ["api.github.com"],
"blockedHosts": [],
"removeRulesOnExit": true
"blockedHosts": []

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

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

This config still declares "version": "0.3.0-alpha" (top of file), which will now be rejected by validate_schema_version() because major version 0 is invalid (must be >= 1) and SUPPORTED_MAJOR_VERSION is 2. Please update this test config to use a supported major (e.g. "2") or omit version so it remains runnable.

Copilot uses AI. Check for mistakes.
Comment on lines 15 to +19
@@ -16,7 +16,6 @@
"defaultPolicy": "block",
"enforcementMode": "both",
"allowedHosts": ["api.github.com"],
"blockedHosts": [],
"removeRulesOnExit": true
"blockedHosts": []

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

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

This config still declares "version": "0.3.0-alpha" (top of file), which will now be rejected by validate_schema_version() because major version 0 is invalid (must be >= 1) and SUPPORTED_MAJOR_VERSION is 2. Please update this test config to use a supported major (e.g. "2") or omit version so it remains runnable.

Copilot uses AI. Check for mistakes.
Comment on lines +530 to +536
let container_name = if request.container_id.is_empty() {
"CLI".to_string()
} else {
request.container_id.clone()
};
self.app_container_sid = Self::create_app_container_sid(&container_name)?;
self.app_container_name = container_name;

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

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

container_name is derived from request.container_id here and then re-derived again later in run(). Consider centralizing this (e.g., a small helper that returns the effective container name, or reusing self.app_container_name after initialize()) to avoid future divergence if the default name logic changes.

Copilot uses AI. Check for mistakes.
@SohamDas2021
Soham Das (SohamDas2021) force-pushed the user/sodas/ConsolidateConfigParams_4 branch from f2deb71 to 4b3af02 Compare March 26, 2026 19:55
Removes all dual-read fallback code for legacy config fields (script,
workingDirectory, top-level timeout, appContainer.name, lxc.containerName,
lxc.destroyOnExit, clearPolicyOnExit, removeRulesOnExit, container alias).
Process section is now required. Runners read from container_id and lifecycle
instead of removed ContainerPolicy/LxcConfig fields. Bumps
SUPPORTED_MAJOR_VERSION to 2. Schema renamed to v2.

Co-authored-by: Copilot <[email protected]>
All example configs, test configs, schema file, and docs now use version '2'
to match SUPPORTED_MAJOR_VERSION. The previous '0.3.0-alpha' would be rejected
by the version validator (major 0 is invalid).

Co-authored-by: Copilot <[email protected]>
@SohamDas2021
Soham Das (SohamDas2021) force-pushed the user/sodas/ConsolidateConfigParams_4 branch from 6b1b561 to 097eb99 Compare March 26, 2026 20:58
Comment thread docs/schema.md Outdated

### Full Schema

```json
{
"version": "0.3.0-alpha", // Schema version (current: "0.3.0-alpha")
"version": "2", // Schema version (current: "2")

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.

No. SemVer. This should be 0.4.0-alpha.

Comment thread docs/schema.md Outdated
higher than the binary supports are rejected with an error suggesting to upgrade
`wxc-exec`. Missing `version` is accepted (treated as version 1). Additive
changes (new optional fields) do not require a version bump.
MXC config files include an optional `version` field that declares the schema

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.

If this is optional, the latest must be assumed. Do we require backward compatibility of all changes to the schema?

Comment thread docs/schema.md Resolved
Comment thread schemas/mxc-config.v2.schema.json Outdated
"type": "object",

"required": ["process"],

"properties": {
"version": {
"type": "string",
"description": "MXC config schema version. Current: '0.3.0-alpha.",
"examples": ["0.1.0"]
"description": "MXC config schema version. Current: '2'.",

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.

No. SemVer.

Replaces integer version ('2') with proper semver ('0.4.0-alpha') per
https://semver.org/. Parser now compares major.minor (pre-release labels
ignored). Schema file renamed from mxc-config.v2.schema.json to
mxc-config.schema.json (version is inside the file, not the filename).

Co-authored-by: Copilot <[email protected]>
@SohamDas2021
Soham Das (SohamDas2021) merged commit 100e140 into main Mar 26, 2026
13 of 16 checks passed
@MGudgin
Gudge (MGudgin) deleted the user/sodas/ConsolidateConfigParams_4 branch April 9, 2026 14:11
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.

3 participants