feat(hooks): make intake-sweep config bugs visible instead of quiet#282
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the fail-quiet gap flagged when #279 shipped: an unknown
kindnow warns on stderr, and a new--checkverb reports each source's raw yield before dedup.Why this shape
A typo'd
kindskipped the source in total silence, and a dead path or wrong field map looked exactly like a source with nothing new.--checkis 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.sh28/28 (9 new), including negative controls that--checkstages nothing and that a broken sibling source does not stop a good one.tests/test-meta.sh0 FAIL.Real-world value already: the first
--checkrun against the live config confirmed thesafari-collectionsadapter is wired correctly and Safari on this machine genuinely has no saved Tab Groups or Reading List items (verified independently:safari-tabs collectionsreturns[]with exit 0 for all three source modes). That was the one untested path called out in #279.