Title
worklog sources: source listing and event counts
Summary
Implement worklog sources: list each configured source with its resolved
paths/state and the event counts it would contribute for the given
--date, including per-originator counts for Codex (the noise-tuning tool
promised by the research doc).
Context
Users need a dry-run view to answer "why is my report empty?" and "which
originators should I exclude?" without generating a report. This command is
also the human-facing probe for known unknown U2 (Codex automation noise).
Scope
internal/cli/sources.go (replace stub), a small Meta-count extension
point in the collector result handling, tests.
Detailed Requirements
-
Runs the normal collect pipeline (same wiring as 25, honoring
--source) for the --date day range, but instead of aggregating,
prints per source (stdout, English, deterministic order zsh, git,
claude-code, codex):
zsh enabled ~/.zsh_history 42 commands
git enabled 2 repos under 1 root 7 commits
claude-code enabled ~/.claude/projects 3 sessions
codex enabled ~/.codex/sessions 5 sessions
originators: cli=3 auto-orchestrator=2
warnings:
[zsh] zsh_no_timestamps: ...
- Column alignment fixed-width (
%-12s %-9s %-34s); paths
tilde-abbreviated. Second-column states (exactly three): enabled
(collected this run), disabled (off in sources.enabled config),
skipped (enabled in config but excluded by --source for this run;
rendered as skipped (--source)). disabled/skipped rows print -
for counts.
- Codex originator sub-line: counts by
Meta["originator"] over
collected codex events, sorted by count desc then name; only when
codex enabled and ≥ 1 session. Excluded originators (config) are NOT
visible here (they were skipped at parse); add trailing note
(N originators excluded by config) when exclude_originators is
non-empty — implement by having the codex provider count skipped
files into a Meta-free side channel: extend the provider with a
SkippedByOriginator() int method captured after Collect (simple,
no interface change).
- Warnings section: same formatting as reports' stderr lines, but on
stdout (this command's output IS the diagnostic).
-
Counts are per event Kind (commands/commits/sessions naming per source).
-
Exit 0 always (diagnostics), except harness errors (exit 2 path from
07).
-
No LLM involvement, no redaction needed (counts only — but note:
originator strings print raw → pass through sanitize.Line(…, 60)).
-
Global flags (DESIGN §4): --config, --date (the counted day),
--verbose honored; --lang parses but is ignored (output is
English-only, like doctor).
Acceptance Criteria
Validation
go test -race ./internal/cli/ -run Sources -v + golden in PR.
Dependencies
07, 08, 10, 12, 14, 15.
Non-goals
Doctor-style fix guidance (28 owns that), historical ranges (single day
only in v1), JSON output (v2 if scripting demand appears).
Design References
docs/DESIGN.md §4, §7.4 (originators), §15 (U2)
docs/research/codex-session-format.md
Source of truth: docs/issues/29-cmd-sources.md (PR #1, branch docs/v1-design). If this issue and the repo docs disagree, the docs win. Execution order and dependencies: docs/ISSUE_PLAN.md (this is issue 29 of 33).
Title
worklog sources: source listing and event countsSummary
Implement
worklog sources: list each configured source with its resolvedpaths/state and the event counts it would contribute for the given
--date, including per-originator counts for Codex (the noise-tuning toolpromised by the research doc).
Context
Users need a dry-run view to answer "why is my report empty?" and "which
originators should I exclude?" without generating a report. This command is
also the human-facing probe for known unknown U2 (Codex automation noise).
Scope
internal/cli/sources.go(replace stub), a smallMeta-count extensionpoint in the collector result handling, tests.
Detailed Requirements
Runs the normal collect pipeline (same wiring as 25, honoring
--source) for the--dateday range, but instead of aggregating,prints per source (stdout, English, deterministic order zsh, git,
claude-code, codex):
%-12s %-9s %-34s); pathstilde-abbreviated. Second-column states (exactly three):
enabled(collected this run),
disabled(off insources.enabledconfig),skipped(enabled in config but excluded by--sourcefor this run;rendered as
skipped (--source)).disabled/skippedrows print-for counts.
Meta["originator"]overcollected codex events, sorted by count desc then name; only when
codex enabled and ≥ 1 session. Excluded originators (config) are NOT
visible here (they were skipped at parse); add trailing note
(N originators excluded by config)whenexclude_originatorsisnon-empty — implement by having the codex provider count skipped
files into a
Meta-free side channel: extend the provider with aSkippedByOriginator() intmethod captured after Collect (simple,no interface change).
stdout (this command's output IS the diagnostic).
Counts are per event Kind (commands/commits/sessions naming per source).
Exit 0 always (diagnostics), except harness errors (exit 2 path from
07).
No LLM involvement, no redaction needed (counts only — but note:
originator strings print raw → pass through
sanitize.Line(…, 60)).Global flags (DESIGN §4):
--config,--date(the counted day),--verbosehonored;--langparses but is ignored (output isEnglish-only, like doctor).
Acceptance Criteria
matching the fixture ground truth, originator sub-line correct.
--source gitrun lists only git as enabled-and-counted, othersshown
skipped (--source).0 commands+ the warning line.Validation
go test -race ./internal/cli/ -run Sources -v+ golden in PR.Dependencies
07, 08, 10, 12, 14, 15.
Non-goals
Doctor-style fix guidance (28 owns that), historical ranges (single day
only in v1), JSON output (v2 if scripting demand appears).
Design References
docs/DESIGN.md§4, §7.4 (originators), §15 (U2)docs/research/codex-session-format.mdSource of truth:
docs/issues/29-cmd-sources.md(PR #1, branchdocs/v1-design). If this issue and the repo docs disagree, the docs win. Execution order and dependencies:docs/ISSUE_PLAN.md(this is issue 29 of 33).