Skip to content

Artifact cap probe misclassifies oversized or invalid-path files as max_files #205

Description

@danny-avila

Summary

When the output-file cap is already full, findTruncatedArtifact() treats the first supported filename as an omitted artifact before applying the normal walk path-shape and file-size checks.

Impact

An oversized file or a supported file with an invalid/overlong path can be reported as artifact_truncation.reasons.max_files, even though an uncapped walk would classify it as size or path. Callers therefore receive the wrong truncation reason for an artifact that was never eligible for collection under the normal walk.

Relevant code

  • api/src/job.ts: findTruncatedArtifact() returns relativePath for supported files after suppression checks, without checkPathShape() or the runtime file-size check
  • walkDir() records that returned path as max_files when the output cap is full
  • the ordinary file path applies filename filtering, path-shape validation, and size classification before collection

Suggested direction

Make the bounded probe apply the same eligibility/classification order as the ordinary walk while preserving its I/O budgets. Add tests where the cap is full and the next supported artifact is oversized or has an invalid path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions