con / con/duct

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

Open
#408 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
12
Forks
6
Avg merge
5d 18h
Merged PRs (30d)
2

Description

## 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

```sh
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.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two commands with --record-types and inspect the handling of disabled records and their output files. Done means disabled record types no longer leave 0-byte files, and con-duct ls does not silently encounter an empty info.json; verify both JSON and JSONL cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.