Skip to content

feat: implement Phase 2A VMLab dry-run argv generation and CommandPlan integration #56

@SSobol77

Description

@SSobol77

feat: implement Phase 2A VMLab dry-run argv generation and CommandPlan integration

Purpose

Implement deterministic dry-run QEMU argv generation and CommandPlan integration for VMLab.

Mandatory First Step

Before editing files:

  1. Inspect the actual repository structure.
  2. Verify real package roots, CLI entrypoints, and test conventions.
  3. Do not assume imports from non-existent modules.
  4. Adjust file paths to the real repository layout if required.
  5. Document any path deviation in the PR description.

Development Log Invariant

All generated development logs, dry-run reports, smoke outputs, test evidence, and agent-generated debug artifacts must be written only under:

logs/

Forbidden generated-artifact locations:

.ecli/
.ecli/vmlab/
src/
tests/
tmp/
.tmp/
.cache/
$HOME/
/tmp/
project root outside logs/

Critical Contract Rules

No subprocess, no QEMU execution, no socket opening, no filesystem mutation, no sudo/doas/pkexec, no mutating QMP.

Target Files

Expected target files, adjusted only if real repository layout requires:

src/ecli/extensions/vmlab/argv_generator.py
src/ecli/extensions/vmlab/service.py
src/ecli/extensions/vmlab/doctor.py
tests/extensions/vmlab/test_argv_generator.py
tests/extensions/vmlab/test_service_integration.py
tests/extensions/vmlab/test_dry_run_guarantee.py

Scope

Required behavior:

  • generate_argv(profile, dry_run=True) returns list[str].
  • no shell parsing.
  • path-like fields resolved safely.
  • acceleration mode included.
  • QMP and serial args included if configured.
  • VMLabService.generate_start_plan(profile, dry_run=True) returns CommandPlan.

Hashing specification:

  • profile_hash: SHA-256 of canonical TOML serialization.
  • argv_hash: SHA-256 of \x00.join(argv).
  • hashes are stored as sha256:<full-hex>.

Deterministic argv ordering:

  1. machine and accel flags
  2. CPU/SMP/memory
  3. storage devices in profile-defined order
  4. network devices in profile-defined order
  5. QMP before serial
  6. VM name last

Dependencies

Depends on Services Foundation and VMLab profile discovery.

Acceptance Criteria

  • deterministic argv generation
  • identical profile/platform yields byte-identical argv
  • generated start plan is draft/validated only
  • plan metadata includes profile_hash, argv_hash, acceleration_resolved, qmp_socket_path, serial_config_summary, development_log_root
  • dry-run creates no files
  • tests prove no mutation
  • no logs outside logs/

References

  • docs/extensions/vmlab-implementation-prompt.md
  • docs/extensions/vmlab-profile-schema.md §8
  • docs/architecture/command-plan-service.md

Labels

  • type:implementation
  • area:vmlab
  • area:services
  • phase:2A
  • status:blocked
  • priority:high

Milestone

v0.3.0 — VMLab Skeleton

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:servicesShared service-layer architecturearea:vmlabVMLab runtime-management moduleimplementationProduction code implementationphase:2APhase 2A — VMLab skeletonpriority:highHigh-priority taskservicesShared service-layer architecturestatus:blockedBlocked by dependencytype:implementationProduction code implementationvmlabVMLab runtime-management module

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions