Repository navigation
Integration event delivery defects: doubled paths, tmp-file leaks, duplicate alias delivery, self-echo of writeback files #99
Description
Activity
PR ready: #101
Acceptance mapping for #99:
- Doubled provider/channel path segments: fixed in Pear by normalizing local Relayfile watcher filenames before translating to remote paths. Added regression coverage for both observed doubled variants.
- Dotfile /
*.tmp-*artifacts: filtered at the bridge boundary, alongside existing discovery/index/schema suppression. Added regression coverage for.meta.json.tmp-*and dotfile paths. - Duplicate alias/raw delivery: canonical mount-relative dedupe is preserved and now also keys same logical changes by revision/content fingerprint so raw and alias paths for the same record change inject once. Added same-revision raw/alias regression.
- Self-echo of writeback files: Pear now suppresses Relayfile
agent_writeevents and filters local Slack/chat writeback command filenames before injection. Added regressions for both origin filtering and command filename filtering.
All four defect classes were root-caused to Pear event bridge behavior; no cloud or Relayfile SDK changes were required.
Validation on the rebased branch after PR #98 landed:
node --experimental-strip-types --no-warnings --test src/main/__tests__/integration-event-bridge.test.tsnpm testnpm run buildgit diff --check
Shipped fixes per acceptance criterion:
- Doubled event paths: Pear now normalizes local Relayfile watcher filenames before remote path translation, covering both observed doubled variants. Regression test covers absolute/already-rooted filenames under a message root and remote-root-relative filenames under
messages/. - Dotfile / temp artifacts: Pear filters dotfile leaves and
*.tmp-*artifacts before event fanout; tests assert no sends and nolistAgentslookup for those filtered paths. - Alias/raw duplicate delivery: Pear dedupes by canonical mount-relative path and uses revision/content fingerprints to suppress same logical changes delivered under both raw and alias paths. Regression covers same-revision raw +
__proj-cloudalias delivery. - Self-echo of writeback files: Pear suppresses Relayfile
origin=agent_writeevents and filters the observed Slack/chat writeback command filenames before injection. Regression covers both origin-based and filename-based suppression.
Validation before merge at approved head
7abc2f4:node --experimental-strip-types --no-warnings --test src/main/__tests__/integration-event-bridge.test.tsnpm testnpm run buildgit diff --check- GitHub CI
checksandpackaged-mcp-smokegreen
Follow-up note from review, not included in #101 because it was non-blocking and explicitly dispositioned as follow-up:
isLikelyLocalWritebackCommandPathcurrently matchesmessages/repliesat any depth. Concrete failure mode to test/fix later: a legitimate nested non-numeric.jsonprovider record under a message subtree, for examplemessages/<ts>/files/<name>.json, could be silently suppressed even though the observed self-echo files were direct children ofmessages/orreplies/. A tighter follow-up should require the leaf parent segment to bemessagesorrepliesand add a nested-record regression.- Doubled event paths: Pear now normalizes local Relayfile watcher filenames before remote path translation, covering both observed doubled variants. Regression test covers absolute/already-rooted filenames under a message root and remote-root-relative filenames under
Follow-up PR: #111
This tightens the writeback self-echo heuristic to direct-child
messages/repliesonly, preserving the observed direct-child Slack echo suppression while keeping the nested non-numeric Slack record injection regression green in the replay window.Validation:
node --experimental-strip-types --no-warnings --test src/main/__tests__/integration-event-bridge.test.tsnpm testnpm run buildgit diff --check
Observed live on 2026-06-05 ~14:09–14:18 UTC during a historical resync flood in workspace
agentrelayworkspace(Slack channelC0AD7UU0J1G/ #proj-cloud), injected into a Claude Code agent session asrelayfile.changedevents. The flood/backpressure architecture is covered by #82 (see the live-repro comment there); this issue tracks the discrete delivery defects that are independent of backpressure work.1. Malformed doubled event paths
Many events arrived with the channel/message path duplicated inside itself, in two variants:
Looks like a path-join defect (relative path appended to an already-resolved root) somewhere in the event emit or mount-relative translation. These paths don't resolve to real records, so consumers can't fetch context for them.
2. Sync-internal temp files delivered as events
Atomic-write temp artifacts (dotfiles,
*.tmp-*) should be filtered before event emission/injection.3. Duplicate delivery across channel alias paths
The same logical record was delivered under both the raw id path (
/slack/channels/C0AD7UU0J1G/...) and the aliased path (/slack/channels/C0AD7UU0J1G__proj-cloud/...), and the samemeta.jsonwas re-delivered 3+ times within minutes without content changes. Consumers should receive one event per logical change.4. Self-echo of writeback files
An agent's own writeback command files (e.g.
claude-1-codex-spawned.json,claude-1-issue82-ack.jsonwritten to the messages/replies writeback surface) were delivered back to that same agent as incoming integration events. Without origin filtering this is a feedback-loop primitive: an agent that responds to events by writing writeback files triggers new events to itself.Acceptance criteria
*.tmp-*artifacts.Related: #82 (Tracks B/C cover flood coalescing and historical-replay suppression; this issue is the correctness layer underneath).