Skip to content

Source ingest gating: allow / ignore / deny#384

Merged
passcod merged 7 commits into
mainfrom
claude/source-ingest
Jul 21, 2026
Merged

Source ingest gating: allow / ignore / deny#384
passcod merged 7 commits into
mainfrom
claude/source-ingest

Conversation

@passcod

@passcod passcod commented Jul 20, 2026

Copy link
Copy Markdown
Member

🤖 Adds the second dimension of source policy — an ingest mode — building on the source-reachability PR.

Each source carries an ingest mode governing whether the device API accepts its reports:

  • allow — ingested normally (default);
  • ignore — the push is accepted (200) but the source's data is discarded, recording nothing;
  • deny — the push is rejected (403).

Gating is per source, so other sources on the same server are unaffected; the reserved canopy/manual sources are never gated.

Reachability interaction. A source that isn't ingested has no fresh data to judge, so it's excluded from reachability regardless of its reachability mode. In the Sources table, setting a source to ignore/deny disables its reachability control (shown as off).

Changes.

  • source_policies.ingest (allow/ignore/deny, default allow) + IngestMode.
  • Push-handler enforcement in the public server (new AppError::IngestDenied → 403, documented in ERRORS.md).
  • The reachability sweep drops non-allow sources from the expected set.
  • set_source_ingest endpoint; the Sources table gains an ingest toggle.
  • Tests: reachability exclusion, push gating (deny/ignore/allow), Playwright ingest toggle.

passcod added 6 commits July 21, 2026 11:15
Adds source_policies.ingest (allow/ignore/deny, default allow), IngestMode
in commons-types::source, and SourcePolicy ingest field + ingest_modes /
ingest_for / set_ingest. list_sources returns the ingest mode. schema.rs
hand-edited.
Public-server push handler gates on the source's ingest mode: deny rejects
(403 AppError::IngestDenied), ignore accepts but records nothing, allow
ingests. The reachability sweep excludes non-allow sources (no fresh data).
sources endpoint + set_source_ingest; Sources table gains an ingest toggle
that greys reachability when not allow. Tests: reachability exclusion,
push gating (deny/ignore/allow), Playwright ingest toggle.
An ignored push must skip only recording, not the response: backup
instructions, tags, and check severities come from server state, so an
ignored reporter (e.g. a legacy alertd) still needs them. Gate just the
write transaction on the ingest mode; compute and return the response as
normal. Test asserts the backflow (a catalogued severity) survives ignore.
@passcod
passcod force-pushed the claude/source-ingest branch from bb932cc to 6cfae7d Compare July 20, 2026 23:40
CHK says severity rules evaluate against the server's effective tags, but
the push handler was feeding only the raw merged server+group tags. Feed
file_health_events the effective tags (the same set returned to the
device: merged tags + synthetic canopy:* + computed billing.*), computed
once and reused for the response — so a rule can predicate on any of them.
@passcod
passcod added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 7ff5283 Jul 21, 2026
7 checks passed
@passcod
passcod deleted the claude/source-ingest branch July 21, 2026 00:39
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