Skip to content

Support directory input for completeness command #30

@wiebe-vandendriessche

Description

@wiebe-vandendriessche

Problem or motivation

  • completeness only accepts a single file via --input

  • Cannot compute scores for multiple AIBOMs in a directory

  • aibomgen typically outputs multiple BOMs per run

  • Users must manually script iteration

  • Current flow:

    bom, err := bomio.ReadBOM(inputPath, inputFormat)

    assumes a single file and couples parsing with execution

  • No batch processing support:

    • no file discovery
    • no filtering by .json / .xml
    • no aggregation of results
  • Limited usefulness in automation:

    • cannot compute scores across a dataset
    • no average or summary metrics
    • --plain-summary only works per file

Proposed solution

  • Extend --input to accept:

    • single file
    • directory
  • Add directory handling:

    • detect directory input
    • list and filter .json / .xml files
    • optional recursive traversal
  • Batch processing:

    • run completeness check per file
    • collect results across all BOMs
  • Improve output:

    • per-file scores
    • aggregated summary:
      • average score
      • total files
      • distribution (optional)
  • Extend --plain-summary:

    • support multi-file output (one line per file)
    • optional aggregated summary line
  • Refactor:

    func ListBOMFiles(path string) ([]string, error)

Alternatives considered

  • Keep single-file model and rely on external scripting

    • rejected due to poor UX
  • Add separate batch command (e.g. completeness-dir)

    • rejected due to duplication
  • Only support glob input

    • less intuitive than directory support

Additional context

  • Needed for evaluating multiple generated AIBOMs
  • Improves integration with CI pipelines and benchmarking workflows
  • Consistent with expected behavior of analysis tools

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions