Skip to content

fix: undo #88 duplicates that collided with #86/#87#89

Merged
Gradata merged 1 commit intomainfrom
fix/undo-88-dupe
Apr 15, 2026
Merged

fix: undo #88 duplicates that collided with #86/#87#89
Gradata merged 1 commit intomainfrom
fix/undo-88-dupe

Conversation

@Gradata
Copy link
Copy Markdown
Owner

@Gradata Gradata commented Apr 15, 2026

Context

#88 merged at 17:40 UTC, ~50 min after #86 (16:48) and #87 (16:52) from a parallel session. Git merged without line conflicts but the diffs overlap:

Area #86/#87 #88 Action
brain.py:apply_brain_rules rules.injected emit #86 wired it (rich payload, try/except) #88 added a second thinner emit after cache.put Remove #88's emit
.gitignore /cloud/ + /sdk/ #87 added #88 re-added Remove #88's duplicates
.gitignore /railway.toml + apollo-leads-*.csv #88 added Keep
tests/test_session_history.py regression test #88 added Keep (complements #86's test_wiring_compound.py)

Net effect before this PR

Double-fire of rules.injected on every fresh compute. Harmless in practice — SessionHistory.injected_this_session is a set so dedup is automatic — but wrong, and other subscribers could be confused by the inconsistent payload shape between the two emits.

Tests

pytest tests/test_session_history.py tests/test_wiring_compound.py tests/test_integrations.py → 50 pass.

🤖 Generated with Claude Code

#88 landed at the same time as #86 and #87 shipping from a parallel
session. The merges didn't conflict line-wise, but the diffs overlap:

- brain.py:apply_brain_rules — #86 already wired `rules.injected`
  with a richer payload (id + category + confidence + state + scope)
  and try/except guard. #88 added a second thinner emit after the
  cache.put. Result: double-fire on fresh compute. Harmless in
  practice — SessionHistory dedups via a set — but clearly wrong.
  Removing #88's emit, keeping #86's.

- .gitignore — #87 already added `/cloud/` and `/sdk/`. #88's re-adds
  are duplicates. Removing; keeping `/railway.toml` and
  `apollo-leads-*.csv` which are genuinely new from #88.

The regression test in tests/test_session_history.py stays — it
asserts the emit fires end-to-end from a real Brain + correct() loop,
complementing #86's test_wiring_compound.py coverage of payload shape.
Both pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Gradata has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@Gradata Gradata merged commit 902d550 into main Apr 15, 2026
8 of 10 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 96cd1a24-0cbc-417e-87f5-cbc8a675af2e

📥 Commits

Reviewing files that changed from the base of the PR and between ca63494 and 553bf3c.

📒 Files selected for processing (2)
  • .gitignore
  • src/gradata/brain.py

📝 Walkthrough
  • Removed redundant rules.injected event emission in Brain.apply_brain_rules() method that was causing duplicate firing on fresh compute
  • Eliminated duplicate .gitignore entries (/cloud/ and /sdk/) that were previously added in PR #87
  • Retained genuinely new .gitignore entries from PR #88 (/railway.toml and apollo-leads-*.csv)
  • Retained regression test (test_session_history.py) from PR #88 to verify end-to-end emit behavior
  • No breaking changes, security fixes, or public API modifications

Walkthrough

The PR removes two root-level directory ignore rules from .gitignore and eliminates a redundant unconditional event emission in Brain.apply_brain_rules() that duplicated functionality already provided through the existing event bus integration path.

Changes

Cohort / File(s) Summary
Configuration
.gitignore
Removed ignore rules for /cloud/ and /sdk/ directories.
Event Emission Refactor
src/gradata/brain.py
Removed redundant rules.injected event emission that was firing unconditionally after rule caching; the method now relies solely on the earlier event bus integration path which provides richer rule fields and scope.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

bug

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/undo-88-dupe

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the bug Something isn't working label Apr 15, 2026
@Gradata Gradata deleted the fix/undo-88-dupe branch April 17, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant