Skip to content

chore(core): log replication-op emit failures in visibility/applicability mutators#1107

Closed
kunickiaj wants to merge 1 commit into
feat/g1-sticky-token-metricfrom
feat/g1-replication-emit-logging
Closed

chore(core): log replication-op emit failures in visibility/applicability mutators#1107
kunickiaj wants to merge 1 commit into
feat/g1-sticky-token-metricfrom
feat/g1-replication-emit-logging

Conversation

@kunickiaj
Copy link
Copy Markdown
Owner

@kunickiaj kunickiaj commented May 20, 2026

Description

updateMemoryVisibility and updateMemoryApplicability both wrapped recordReplicationOp in a silent try/catch with "Non-fatal" as the only comment. The intent (don't fail the user-facing mutation on a replication hiccup) is correct, but the silence hides whatever actually broke the replication path — peers stop learning about the change and no signal reaches the operator.

This replaces the swallow with a structured console.warn using the existing [codemem] prefix convention (matches the rest of the codebase — e.g., db.ts, observer-client.ts, sync-discovery.ts). The warning includes the memory id and the error message so a failure leaves a forensic trail without crashing the caller. Behavior is otherwise unchanged.

Type of Change

  • 🔧 Maintenance (refactor, chore, CI, etc.)

Testing

  • Relevant checks pass locally (pnpm run tsc, pnpm run lint, pnpm run test) — workspace 1995/1995
  • Added/updated tests for changes — observability-only change, no new tests; the existing replication-op emit tests already exercise the happy path
  • Manually verified changes work as expected — log message format matches existing [codemem] log lines

Checklist

  • Code follows project style (pnpm run lint passes for touched files)
  • Self-review completed
  • Documentation updated (if needed) — N/A
  • No new warnings introduced

Copy link
Copy Markdown
Owner Author

kunickiaj commented May 20, 2026

…lity mutators

updateMemoryVisibility and updateMemoryApplicability both wrapped
recordReplicationOp in a silent try/catch with "Non-fatal" as the only
comment. The intent (don't fail the user-facing mutation on a
replication hiccup) is correct, but the silence hides whatever actually
broke the replication path — peers stop learning about the change and
no signal reaches the operator.

Replace the swallow with a structured console.warn using the existing
[codemem] prefix convention. Includes the memory id and the error
message so a failure leaves a forensic trail without crashing the
caller. Behavior is otherwise unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kunickiaj kunickiaj force-pushed the feat/g1-sticky-token-metric branch from b241abf to a68b608 Compare May 20, 2026 23:12
@kunickiaj kunickiaj force-pushed the feat/g1-replication-emit-logging branch from 97a4fd1 to 6dcf0ff Compare May 20, 2026 23:12
@kunickiaj
Copy link
Copy Markdown
Owner Author

Scrapping the layered sticky-rules feature stack. The manual user-pinning premise — "user finds a memory in the feed and clicks a dropdown to broaden its scope" — is friction nobody will reach for. The valuable sticky rules ("use fish shell", "no praise filler") are not memories users would find and pin; they are recurring patterns the observer should infer, and the canonical homes for them already exist (~/.claude/CLAUDE.md for personal prefs, repo AGENTS.md for project rules).

Salvaging the one pre-existing bug surfaced during this work as a focused standalone PR: the silent try/catch swallow around recordReplicationOp in updateMemoryVisibility (the method this PR did not introduce) now logs the failure with the existing [codemem] prefix instead of dropping it on the floor.

@kunickiaj kunickiaj closed this May 20, 2026
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