Skip to content

Lookout follow-ups from #589: scoped examples, shapes off the runtime, exact numbers - #596

Merged
lydakis merged 2 commits into
mainfrom
claude/project-thread-0nccgi
Nov 1, 2026
Merged

lydakis merged 2 commits into
mainfrom
claude/project-thread-0nccgi

Conversation

@lydakis

@lydakis lydakis commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Closes #589. This covers the three items left after #592, all from the #580 review.

Subscription examples leak across subscriptions (r4434605111)

Shapes kept one example per field from whatever event came last, and every subscriptions caller saw it. That included, for example, another commons thread's post. Now:

  • A shape keeps its last 8 events, cut short: strings at 120 characters, lists at 8 items, objects 4 levels deep, at most 8 KiB each. Each one records whether anything was cut. Field kinds are kept as before.
  • sources::listed(store, names, subs) shows a field's example only from the newest of those events that one of the caller's subscriptions hears (Sub::hears: source, topic and filter). A filter is never trusted to judge a cut event. Every other caller sees kinds only.
  • When any example shows, the answer adds examples: a warning that the examples are outside content, worded as the source note's warning is.

Shape persistence on the lookout's runtime thread (r4434605112)

Shape::flush now hands the body to a thread of its own (sources::shapes). That thread coalesces queued writes so that only the newest body per file is written, so a source whose fields churn costs one write at a time and never blocks event handling. Shapes still get written whole and then moved into place.

Numeric filters lose integer precision (r4434605115)

pattern::compare compares exactly. Two whole numbers (i64 or u64) compare as i128. A float against a whole number compares by whole part and then by the remaining fraction, with no rounding. Two floats compare as floats. numeric and plain equality both use it, so 2^53 + 1 no longer equals 2^53, and a float bound such as 9007199254740992.0 is ordered correctly against 2^53 + 1.

Tests

  • numbers_past_a_float_s_precision_compare_exactly: 2^53 ± 1, u64::MAX, negatives past 2^53, and float bounds against whole numbers.
  • examples_come_only_from_events_the_caller_hears: a commons thread subscriber sees its own thread's post and never the newer one from another thread. Non-subscribers see kinds only. A filter is not trusted with a cut event.
  • a_filter_narrows_sources_and_warns_of_fields_no_event_had (subs) now checks that the example comes from the newest event the caller's filter hears, not the newest overall, that the warning is present, and that another caller sees kinds only.
  • The shape test covers the writer, the recent-event cap and cutting.
  • cargo test -p sonny: 853 + 2 + 24 passed. cargo clippy -p sonny --all-targets is clean and cargo fmt --check passes.

LOOKOUT.md (shapes, numeric) and the FEATURES.md sources row are updated. The protocol and schema are unchanged.

…, exact numbers

- A subscriptions answer shows a field's example only from the newest
  recent event one of the caller's subscriptions hears (source, topic,
  filter; a filter is not trusted with a cut event), and says under
  `examples` that they are outside content. Shapes keep the last 8
  events cut short instead of one shared example per field, which leaked
  one subscriber's events (e.g. another commons thread) to every caller.
- Shapes are written by a thread of their own, the newest body per file
  winning, so a source whose fields churn never blocks the lookout.
- Numeric filters and equality compare whole numbers exactly as i128 and
  a float against a whole number without rounding, past 2^53.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8Kwbo2wyYcT9yURQ
@lydakis lydakis self-assigned this Nov 1, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T07:50:01.407345Z dbe4c47 New commits
🔒 Security Review ✅ Completed 2026-11-01T07:47:38.306486Z 252926e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 252926e89d

ℹ️ 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".

Comment thread sonny/src/lookout/sources.rs Resolved
…ltered data

Codex on #596: a 123-character string cut to 120 plus the ellipsis kept
its byte length, so the sample read as uncut and a filter on it could
show another event's example; keys cut at 64 never marked it at all.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGG8Kwbo2wyYcT9yURQ
@lydakis
lydakis merged commit 660fda3 into main Nov 1, 2026
10 checks passed
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.

Lookout and commons follow-ups from the after-the-fact reviews (#580, #585)

2 participants