Skip to content

When a pipe returns an empty result, there is no way to tell why #388

Description

@shellicar

A pipe returns its final output and nothing else. When that output is empty, there is no way to tell why: whether the source found nothing, a filter matched nothing, or which stage emptied the stream. The only way to find out is to take the pipe apart and run it a stage at a time.

The same blindness shows up when a pipe returns far more than expected: a filter that matched thousands of lines looks the same as one that matched three, and there is no sign of it until the whole result is already in hand. When a result is large enough to be stored behind a ref, its size and shape are gone too.

In each case the result can only be re-run, not reasoned about.

Guidance

A shape sketched earlier, as one possible answer and not a spec: the result carries a one-line record of what each stage did (Find: 12 files -> Read: 12 files, 1,240 lines -> Match: 3 files, 8 lines), held in an envelope { summary, body } so it survives when the body is stored behind a ref. Worked out but open: units spelled, per-stage counts, 0 files as the empty signal, whether every stage reports.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions