Skip to content

--record-types writes 0-byte files for disabled record types #408

Description

@asmacdo

Summary

--record-types disables specific output records, but the files for the disabled records are still created — as 0-byte files. That's worse than "not created" or "valid empty document": downstream tools silently fail to parse them.

Reproducer

cd "$(mktemp -d)"
duct -t processes-samples -- bash -c 'echo ok; sleep 0.3'
ls -la .duct/logs/*_info.json         # 0 bytes

duct --clobber -t system-summary -- bash -c 'echo ok; sleep 0.3'
ls -la .duct/logs/*_usage.jsonl        # 0 bytes

Observed

  • -t processes-samples: *_info.json is 0 bytes.
  • -t system-summary: *_usage.jsonl is 0 bytes.
  • con-duct ls over a directory containing the empty info.json silently emits nothing (parse error swallowed, no warning).

Expected

Either don't create the file at all when its record type is disabled, or emit a well-formed empty document ({} for info.json, nothing/[] for jsonl). 0-byte is the worst outcome.

Scope

Reproduces on v0.19.0 and current main. Longstanding, not a regression. Surfaced during pre-0.20.0 QE.

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