Skip to content

feat(hooks): make intake-sweep config bugs visible instead of quiet#282

Merged
tieubao merged 1 commit into
masterfrom
feat/intake-check
Jul 20, 2026
Merged

feat(hooks): make intake-sweep config bugs visible instead of quiet#282
tieubao merged 1 commit into
masterfrom
feat/intake-check

Conversation

@tieubao

@tieubao tieubao commented Jul 20, 2026

Copy link
Copy Markdown
Member

What

Closes the fail-quiet gap flagged when #279 shipped: an unknown kind now warns on stderr, and a new --check verb reports each source's raw yield before dedup.

$ intake-sweep.py --check
  ok   dgst-keepers (jsonl): 22 item(s), 22 titled, 22 with url
  WARN safari-collections (command): 0 item(s), 0 titled, 0 with url
intake-sweep check: 2 source(s), 1 needing attention

Why this shape

A typo'd kind skipped the source in total silence, and a dead path or wrong field map looked exactly like a source with nothing new. --check is deliberately not wired into the hook: an empty sweep is a normal daily state, so warning there would fire every session and train you to ignore it. Run it after editing the config; that is when the answer matters.

Test

tests/test-intake-sweep.sh 28/28 (9 new), including negative controls that --check stages nothing and that a broken sibling source does not stop a good one. tests/test-meta.sh 0 FAIL.

Real-world value already: the first --check run against the live config confirmed the safari-collections adapter is wired correctly and Safari on this machine genuinely has no saved Tab Groups or Reading List items (verified independently: safari-tabs collections returns [] with exit 0 for all three source modes). That was the one untested path called out in #279.

Two failure modes were silent. A typo'd `kind` made the whole source vanish
with no signal at all, and a dead path or a wrong field map just yielded zero
items, indistinguishable from a source that legitimately had nothing new.

An unknown `kind` now warns on stderr (always a config bug, never a valid
state; stderr keeps the hook's stdout candidate line clean). A new `--check`
verb reports each source's RAW yield before dedup, so a bad path or map shows
as 0 items when you run it after editing the config. `--check` is deliberately
not wired into the hook: an empty sweep is a normal daily state, so a warning
there would fire every session and train you to ignore it.

Tests: 9 new assertions (28 total), including a negative control that
`--check` is report-only and one for the no-config message.
@tieubao
tieubao merged commit 240119f into master Jul 20, 2026
2 checks passed
@tieubao
tieubao deleted the feat/intake-check branch July 20, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant