Skip to content

NOJIRA-Retire-contact-interactions-proxy-via-peer-events - #1137

Merged
pchero merged 6 commits into
mainfrom
NOJIRA-contact-interaction-retire-to-peer-events
Jul 24, 2026
Merged

NOJIRA-Retire-contact-interactions-proxy-via-peer-events#1137
pchero merged 6 commits into
mainfrom
NOJIRA-contact-interaction-retire-to-peer-events

Conversation

@pchero

@pchero pchero commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Retire bin-contact-manager's self-owned CRM interaction pipeline (contact_interactions/contact_resolutions write path, get-by-id, resolution create/delete, unresolved queue) and proxy the surviving InteractionList RPC/REST path through bin-timeline-manager's peer_events read API instead. Design doc: bin-contact-manager/docs/plans/2026-07-25-contact-interaction-retire-to-peer-events-design.md (§1-§9, 9 rounds of prior review + 3 rounds of implementation review to follow).

  • bin-common-handler: keep ContactV1InteractionList wrapper, now returning peer_events-shaped response; delete ContactV1InteractionGet/ListUnresolved/ResolutionCreate/Delete wrappers and their RequestHandler interface entries and mocks
  • bin-contact-manager: delete EventCallCreated/EventConversationMessageCreated (CRM eligibility filter + projection write path), ResolutionCreate/Delete, InteractionGet, InteractionListUnresolved, and their listenhandler RPC routes and dispatch entries
  • bin-contact-manager: rewrite InteractionList to proxy bin-timeline-manager's peer_events read API via TimelineV1PeerEventList, supporting peer_type+peer_target/contact_id/address_id filters and rejecting unfiltered/since-only queries; returns []*peerevent.PeerEvent unmodified (no field reshaping)
  • bin-contact-manager: delete call-manager/conversation-manager event subscriptions and their now-unused queue bindings
  • bin-openapi-manager: delete 8 contact_interactions/service_agents path files (unresolved, {id} GET, resolutions POST/DELETE, x2); reshape the 2 surviving List path response schemas to reuse TimelineManagerPeerEventListResponse; delete now-unreferenced ContactManagerInteraction/ContactManagerInteractionListResponse/ContactManagerResolution schemas
  • bin-api-manager: keep only the List handler/servicehandler method per resource (top-level + service_agents), delete the other 4 each plus the orphaned interactionGet helper; rewrite tests accordingly
  • bin-ai-manager: update tool_insight.go's field access to the new peer_events-shaped response (TMInteraction→Timestamp, ReferenceType→Publisher)
  • bin-api-manager: update contact_peer_event_overview.rst — GET /contact_interactions no longer documented as an identity-resolved/CRM-filtered alternative to GET /contact_peer_events (both now return the same raw shape); contact_interactions documented as legacy-compatibility-only, rebuild docsdev HTML

pchero added 6 commits July 25, 2026 03:21
…a peer_events

Retire bin-contact-manager's self-owned CRM interaction pipeline
(contact_interactions/contact_resolutions write path, get-by-id,
resolution create/delete, unresolved queue) and proxy the surviving
InteractionList RPC through bin-timeline-manager's peer_events read
API instead. Design doc: bin-contact-manager/docs/plans/2026-07-25-contact-interaction-retire-to-peer-events-design.md

- bin-common-handler: keep ContactV1InteractionList wrapper, now
  returning peer_events-shaped response; delete
  ContactV1InteractionGet/ListUnresolved/ResolutionCreate/Delete
  wrappers and their RequestHandler interface entries and mocks
- bin-contact-manager: delete EventCallCreated/EventConversationMessageCreated
  (CRM eligibility filter + projection write path), ResolutionCreate/Delete,
  InteractionGet, InteractionListUnresolved, and their listenhandler
  RPC routes and dispatch entries
- bin-contact-manager: rewrite InteractionList to proxy
  bin-timeline-manager's peer_events read API via TimelineV1PeerEventList,
  supporting peer_type+peer_target/contact_id/address_id filters and
  rejecting unfiltered/since-only queries; returns []*peerevent.PeerEvent
  unmodified (no field reshaping)
- bin-contact-manager: delete call-manager/conversation-manager event
  subscriptions (callmanager.go/conversationmanager.go) and their queue
  bindings, now unused
…er_events response schema for List

- bin-openapi-manager: delete unresolved/{id}/resolutions POST+DELETE path
  files for both /contact_interactions and /service_agents/contact_interactions
  (8 files total) and their paths: registrations in openapi.yaml
- bin-openapi-manager: repoint the surviving List paths' response schema
  from ContactManagerInteractionListResponse to
  TimelineManagerPeerEventListResponse, matching contact-manager's
  InteractionList RPC now returning peerevent.PeerEvent unmodified
  (design doc §8.1/§9)
- bin-openapi-manager: delete ContactManagerInteraction,
  ContactManagerInteractionListResponse, ContactManagerResolution schemas
  (no remaining references after the above)
… proxy List via peer_events

- bin-api-manager: Trim server/contact_interactions.go and server/service_agents_contact_interactions.go to keep only the List handler; delete Unresolved/Id GET/Resolutions POST/DELETE handlers
- bin-api-manager: Trim pkg/servicehandler/interaction.go and serviceagent_interaction.go to keep only InteractionList/ServiceAgentInteractionList, returning peer_events (peerevent.PeerEvent) unmodified
- bin-api-manager: Update ServiceHandler interface and regenerate mock_main.go
- bin-api-manager: Rewrite interaction_test.go, serviceagent_interaction_test.go, contact_interactions_test.go, service_agents_contact_interactions_test.go for the surviving List functions against the peer_events response shape
- bin-api-manager: Regenerate gens/openapi_redoc and gens/openapi_server from the updated bin-openapi-manager spec
- bin-ai-manager: toolHandleGetContactInteractions consumes bin-common-handler's ContactV1InteractionList peer_events response ([]*peerevent.PeerEvent) instead of the retired interaction.Interaction shape; rename .TMInteraction->.Timestamp (non-pointer) and .ReferenceType->.Publisher, keep .Direction/.Peer.Type/.Peer.Target/.ReferenceID
- bin-ai-manager: update tool_insight_test.go fixtures to build tmpeerevent.PeerEvent responses instead of cminteraction.Interaction
…rement

- bin-api-manager: contact_peer_event_overview.rst no longer describes
  GET /contact_interactions as an identity-resolved/CRM-filtered
  alternative to GET /contact_peer_events; both now return the same
  raw, unfiltered response shape. contact_interactions is documented
  as legacy-compatibility-only (kept for existing callers, plus its
  address_id filter), with contact_peer_events recommended for new
  integrations
- bin-api-manager: rebuild docsdev HTML
PR #1137 round 2 review findings.

- bin-contact-manager: InteractionList's contact_id filter mode now
  returns a distinct CONTACT_HAS_NO_ADDRESSES error instead of the
  generic INVALID_FILTER when a valid contact_id is supplied but the
  contact has zero registered addresses (previously indistinguishable
  from the no-filter-at-all case)
- bin-contact-manager: add test coverage for contact-with-no-addresses
  and RPC-error-propagation on InteractionList
- bin-api-manager: add RPC-error-propagation test coverage to
  InteractionList and ServiceAgentInteractionList servicehandler tests
@pchero
pchero merged commit 036587a into main Jul 24, 2026
14 checks passed
@pchero
pchero deleted the NOJIRA-contact-interaction-retire-to-peer-events branch July 24, 2026 21:02
pchero added a commit that referenced this pull request Jul 24, 2026
Follow-up cleanup for PR #1137 (contact_interactions -> peer_events
retirement, design doc
bin-contact-manager/docs/plans/2026-07-25-contact-interaction-retire-to-peer-events-design.md).
That PR cleaned the handler/RPC/subscription layers; this removes what
design doc §2.4/§3.6 explicitly deferred to a follow-up -- the
now-unreachable models/dbhandler layer and the underlying MySQL tables.

- bin-contact-manager: delete models/interaction, models/resolution
packages entirely
- bin-contact-manager: delete pkg/dbhandler/interaction.go
(Create/Get/List/ListByOwnershipPeriods/ListByIDs/ListUnresolved) and
resolution.go (Create/CreateTx/Delete/ListByInteraction/ListByContact)
- bin-contact-manager: delete pkg/dbhandler/address_ownership_read.go's
OwnershipPeriodsListByContactID/MissingPeriodOwnedAddresses -- existed
solely to support the old InteractionList's ownership-period matching;
the write path (OwnershipPeriodsLockAndResolveTx, used by live Address
CRUD) is untouched
- bin-contact-manager: remove the 9 corresponding DBHandler interface
methods, regenerate mocks
- bin-contact-manager: rewrite
pkg/casehandler/casenote_isolation_test.go for the post-PR-#1137 world
-- InteractionList no longer queries any local table, so the isolation
guarantee is now structural (CaseNoteCreate must never call any
RequestHandler RPC, proven via gomock strict mode on a RequestHandler
mock with zero EXPECT() calls configured)
- bin-contact-manager: drop the SQLite
contact_interactions/contact_resolutions test-fixture tables from
scripts/database_scripts_test/contacts.sql
- bin-dbscheme-manager: add migration d8b04ef3ddd0 dropping the
contact_interactions/contact_resolutions MySQL tables in production.
contact_address_ownership_periods is explicitly NOT touched -- still
live, used by Address CRUD independent of Interaction
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