Skip to content

Apply multiple modules after successful preflight validation #298

Description

@renanfranca

Parent issue

This issue is part of:

Support safe multi-module application from the Seed4J CLI

Dependencies

This issue should be implemented only after completing:

  • Add a read-only plan for applying multiple modules
  • Define transaction, commit, and partial-failure semantics for multi-module application

Goal

Execute a requested set of modules only after the complete set passes preflight validation.

Execution must reuse the same resolved plan shown by --plan, preserve deterministic ordering, and follow the previously defined commit and partial-failure contract.

Proposed command

seed4j apply-set init maven-java prettier \
  --project-path .

Properties should use the same CLI options accepted by plan mode:

seed4j apply-set init maven-java \
  --project-path . \
  --project-name "Sample application" \
  --base-name sampleApplication \
  --node-package-manager npm \
  --package-name com.mycompany.sample

Required behavior

Before applying the first module, the command must:

  1. resolve all requested module slugs;
  2. resolve the deterministic execution order;
  3. validate module dependencies;
  4. validate feature dependencies;
  5. resolve the complete property set;
  6. reject missing required properties;
  7. reject any other predictable invalid state;
  8. build an immutable or otherwise stable execution plan.

The command must then execute the modules from that validated plan.

It must not independently resolve a different order, property set, or dependency result after preflight validation.

Dependency behavior

A dependency may be satisfied by:

  • project history; or
  • an explicitly selected module that appears earlier in the resolved execution order.

A feature dependency must continue to require an explicit provider.

The command must not silently add missing modules or automatically select a feature provider.

Execution reporting

The output should make progress visible for each module.

Example structure:

Applying module set:

[1/3] init
      Applied successfully

[2/3] maven-java
      Applied successfully

[3/3] prettier
      Applied successfully

Module set applied successfully.

When execution fails, the output must distinguish:

  • modules successfully applied;
  • the module that failed;
  • modules skipped because of the failure.

The exact behavior for changes, commits, history, and events must follow the decision made in the transaction and partial-failure issue.

Acceptance criteria

  • Execution is blocked when preflight validation fails.
  • A preflight failure does not modify the project.
  • A preflight failure returns a non-zero exit code.
  • Execution uses the same resolved module order as plan mode.
  • Execution uses the same resolved properties as plan mode.
  • Modules are applied sequentially in deterministic order.
  • A dependency can be satisfied by another selected module.
  • Feature providers are never selected automatically.
  • Progress is displayed for each module.
  • Full success is clearly reported.
  • Partial failure is clearly reported.
  • Succeeded, failed, and skipped modules can be distinguished.
  • Commit behavior follows the previously documented decision.
  • Project-history behavior follows the previously documented decision.
  • Event-dispatch behavior follows the previously documented decision.
  • Exit codes follow the previously documented decision.
  • Existing single-module apply behavior remains unchanged.
  • CLI integration tests cover successful execution.
  • CLI integration tests cover invalid preflight.
  • CLI integration tests cover dependencies satisfied within the requested set.
  • CLI integration tests cover an unexpected failure during execution.
  • Documentation includes multi-module examples.

Out of scope

  • Applying a named preset.
  • User-defined module sets.
  • Parallel module execution.
  • Automatically resolving missing dependencies.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions