Repository navigation
Lookout: subscriptions filter their sources' events with an event pattern; agents see each source's shape - #532
Conversation
…tern; sources keep their fields and the lookout keeps each source's shape A source's event keeps every field its line printed, and a subscription's filter (an EventBridge-style event pattern: prefix, suffix, wildcard, equals-ignore-case, anything-but, numeric, exists, $or) hears only the events it matches, checked as each event comes. The lookout keeps each source's shape (recent fields, kinds, an example) beside the sources' folders, and every subscriptions answer lists it, so an agent knows what it may filter on; a filter naming a field no recent event had is added with an unseen warning. The note quotes an event's other fields. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFwzbMU5CpudVHy4TZ
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54ed429696
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ames only fields that keep a filter from matching Codex review on #532: equal() turned both sides into f64, so integer IDs past 2^53 compared equal; whole numbers now compare as i64/u64. The unseen warning named every field a filter mentioned, even under exists:false or in one $or branch while another could match; pattern::missing now names only fields that keep the pattern from matching an event with the fields a source lately had. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFwzbMU5CpudVHy4TZ
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
@codex security review This PR's one automatic security review failed on the usage limit. Tracked in #531 as riskier: event patterns over outside sources' events, which then reach agents' turns (see #348). Generated by Claude Code |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGEfzPDBTQPwZUKy2bJ
What
George's idea: an agent should see what a programmatic lookout source emits and subscribe with a filter on that data, so only matching events wake it (e.g. a CR source filtered to the paths its work touches).
sources::Eventkeeps every field the line printed (fields, shared viaArc); before, anything beyondtext/id/from/url/urgentwas dropped. The note quotes the other fields as compact JSON after the text, cut at 2,000 chars.Sub.filteris an event pattern in AWS EventBridge / SNS filter-policy syntax (sonny/src/lookout/pattern.rs): fields AND, values OR, list fields match on any item, nested objects,prefix,suffix,wildcard,equals-ignore-case,anything-but,numeric,exists,$or. Checked atadd(4 KiB, 256 values, 6 deep; unknown matchers refused with the supported list). A filter needssources. A hand-edited file with a bad filter hears nothing, not everything.hearing, as each event arrives, before it is held for a note: a non-match never wakes anyone.STORE.sources/.shapes/NAME.json, written when fields change, at most once a minute otherwise, and as each run ends. Everysubscriptionsanswer listssourcesas{name, events, fields}; a filter naming a field no recent event had is added with anunseenwarning.Security
A filter is plain data matched against data, size-bounded, and only ever narrows what a subscriber hears. Agents still cannot define commands. Shape examples are source text that any subscriber could already read.
Coordination
The commons thread is changing the same files (topics, digest, the commons as a built-in source). Its patches are not on main yet. I resolved this change on top of them; the resolved commit is in the project's files (
lookout-filters/0004-filters-on-commons-stack.patch), whereSub::hearsmatchesNAMEorNAME:TOPICand then the filter. Whichever lands second takes that resolution.Tests
pattern.rsunit tests for every matcher,$or, nesting, list fields and the limits.subs.rs: filter add/refuse/round-trip,unseenwarning, listed shapes, bad hand-edited filter hears nothing.sources.rs: events keep other fields, the note quotes them, shape kinds/examples/expiry/flush.mod.rs: a filtered subscription hears only matching events; rehear keeps the filter.tests/test_lookout.py: a CR poller prints two changes, a filtered subscriber is woken with only the billing one, and the shape file records both.cargo test -p sonny,cargo clippy -p sonny --all-targets, andAGENT_TEST_RUNTIME=1 python3 -m unittest tests.test_lookoutpass locally.