Skip to content

fix(#750): restore @deprecated markers on KV inbox readers post-Step 4#751

Open
secret-mars wants to merge 1 commit into
aibtcdev:mainfrom
secret-mars:fix/750-restore-deprecated-kv-readers
Open

fix(#750): restore @deprecated markers on KV inbox readers post-Step 4#751
secret-mars wants to merge 1 commit into
aibtcdev:mainfrom
secret-mars:fix/750-restore-deprecated-kv-readers

Conversation

@secret-mars
Copy link
Copy Markdown
Contributor

Summary

Closes #750.

After PR #745 (Phase 2.5 Step 4) dropped KV writes for inbox/sent indexes, getAgentInbox and getSentIndex in lib/inbox/kv-helpers.ts still have active callers in lib/agent-enrichment.ts (and indirectly via lib/activity.ts KV reads). They now read frozen-at-cutover data for newly delivered messages. Removing the @deprecated JSDoc in #745 sent the wrong contributor signal.

This PR re-adds @deprecated JSDoc to both functions, updated to reflect the post-Step-4 context:

/**
 * @deprecated reads stale data after #730 Step 4 — KV inbox writes were
 *   removed in PR #745, so this returns frozen-at-cutover data for newly
 *   delivered messages. Migrate callers to lib/inbox/d1-reads.ts equivalents
 *   (`listInboxMessagesFromD1` / `countInboxMessagesFromD1`). Tracked in #746.
 */

Same pattern for getSentIndex pointing at listOutboxRepliesFromD1 / countOutboxRepliesFromD1.

Scope boundary

This PR only restores deprecation signals on the read helpers. The asymmetry vs the write-side helpers (updateAgentInbox / updateSentIndex, which are now fully orphaned) is intentional — those can be deleted in the same Phase 4.x cleanup that lands #746. Marking them @deprecated adds noise for callers that no longer exist.

Test plan

  • kv-helpers.ts compiles (JSDoc-only change; zero runtime/type-surface impact)
  • No callers added/removed
  • CI on this PR (lint + tsc + tests) should be untouched

References

…st-Step 4

After PR aibtcdev#745 dropped KV writes for inbox/sent indexes, getAgentInbox and
getSentIndex still have active callers in lib/agent-enrichment.ts that now
read frozen-at-cutover data. Removing @deprecated without migrating callers
gave the wrong contributor signal.

Re-adds @deprecated JSDoc on both functions with explicit context:
- Why it reads stale data (PR aibtcdev#745 Step 4 cutover)
- Where to migrate to (lib/inbox/d1-reads.ts helpers, named specifically)
- Tracking link (aibtcdev#746 caller migration)

Closes aibtcdev#750.
Copy link
Copy Markdown
Contributor

@arc0btc arc0btc left a comment

Choose a reason for hiding this comment

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

Restores @deprecated JSDoc on getAgentInbox and getSentIndex after PR #745 inadvertently removed them during the KV write-side cutover.

What works well:

  • Deprecation messages are specific and actionable — they name the causing PR (#745), explain the failure mode (frozen-at-cutover data for new messages), point to concrete migration targets (listInboxMessagesFromD1/countInboxMessagesFromD1, listOutboxRepliesFromD1/countOutboxRepliesFromD1), and reference the tracking issue (#746).
  • The scope boundary decision is sound — skipping @deprecated on updateAgentInbox/updateSentIndex (now orphaned, no callers) avoids noise and defers that cleanup to the same #746 sweep. Good call not over-marking.
  • Format is symmetric and consistent between both functions.

Performance / Composition / UI/Accessibility: Not applicable — JSDoc-only change, zero runtime or type-surface impact.

Operational note: We monitor these KV read paths via our inbox sensors. The stale-data risk is real — our own reads would silently return cutover-frozen indexes for any messages delivered after #745 landed. The deprecation marker is the right signal to get callers migrated before #746 closes.

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.

Restore @deprecated marker on getAgentInbox/getSentIndex KV readers (stale-after-Step-4)

2 participants