Merge hardening verified on master: psf-memo-db unit (357), property (44),
acceptance (11 suites, including thread-query-performance), and lint all
pass. Record the completion and add a gotcha about upper-bound performance
assertions surviving Gherkin mutation.
By specifier.
Encapsulate the postChildren prefix scan in PostQuery.listChildTxids and have
GetPostThread depend only on the PostQuery interface (listChildTxids,
getPostOrNull). countRepliesForTxids now reuses listChildTxids. Remove the dead
whole-database buildLikeCountMap that this task made obsolete. Cover the
prefix-scan guards and cycle back-edge, realign the thread property tests to the
adapter seam, and refresh mutation/Gherkin-acceptance manifests.
By architect.
Scope the thread endpoint to per-thread reads:
- Count likes for only the thread's txids via countLikesForTxids instead of
the whole-database buildLikeCountMap scan.
- Prefix-scan postChildren by parent txid in loadChildTxids instead of walking
the entire store for every node.
- Add unit tests pinning bounded postChildren reads and thread-scoped likes.
By coder.
Bound /posts/:txid/thread to per-thread reads: prefix-scan postChildren
by parent txid and scope like counts to the thread's txids instead of
the global postLikes scan. Record both implementation parts in the
feature backlog.
By specifier.
Extract reply/mute eligibility check into PostQuery.isEligibleRecentPost,
lowering scanRecentPostTxidsAndCount CRAP from 7 to 6. Refresh mutation
manifest.
By refactorer.
- Replace full-postHeights and full-postChildren scans in ListRecentPosts with
a single capped scan and per-page reply counting.
- Add PostQuery.scanRecentPostTxidsAndCount with TOTAL_SCAN_CAP=10.
- Update acceptance handlers and fixture for the new feed-query-performance
spec, and add entry-count wrappers for bounded-read assertions.
By coder.
Fix Adapters.openDatabases so muteQuery is constructed before postQuery, which
previously resolved an undefined muteQuery at PostQuery construction and silently
disabled recent-feed mute filtering. Fix the follow-notification key fallback to
strip the :<followeePkHash> suffix instead of key.split(':')[0] (which yielded
only the "bitcoincash" network prefix). Add unit tests for the shared muted-posts
helper and the follow key-fallback path.
By architect.
Extract the duplicated _mutedAddrs lookup and _isMutedPost check into a shared
lib helper (loadMutedAddrs / isMutedPost) used by the post, topic, search, and
notifications adapters. Extract follow/like notification predicates in
NotificationsQuery to bring CRAP down to 6. Add a mute-filtering conservation,
exclusion, and pagination property test for topic queries.
By refactorer.
Follow/mute/unfollow/unmute now broadcast the target's raw 20-byte hash160
as the OP_RETURN payload via a browser-safe Uint8Array (no Node Buffer
global), shared through the new MemoStateAction base.
By specifier.
Extract the near-identical follow/unfollow and mute/unmute action classes
onto a config-driven MemoStateAction base, removing 150 duplicated lines.
Preserves public API and static exports. Coder's hexToBytes broadcast stays
intact. Refreshed mutation manifests via the tool.
By refactorer.
Replaces the Node-only Buffer global in memo-follow and memo-mute with
the existing hexToBytes helper, which returns a Uint8Array. Updates unit
and property tests to assert bytes without requiring Buffer in the
production source, and adds an acceptance handler for the new binary
payload wording so the Binary Payload Broadcast regression spec passes.
By coder.
Client follow/mute (and their inverse unmute/unfollow) must broadcast the
target's raw 20-byte hash160 as the OP_RETURN payload and must not depend on
the Node-only Buffer global. Adds the Binary Payload Broadcast regression
spec covering the binary payload for all four actions.
By specifier.
Merge finalized architect work: reduce paginated client page size to 50,
refactor paginated pages onto a shared base, and carry in the reviewed
youtube-embed property tests and startup smoke-check polish.
By specifier.
Extract PaginatedPage base for the recent feed and recent profiles page
controllers to remove the duplicated load/canLoadMore pattern introduced
with the 50-item page size. Refresh mutation manifests via the tool. Add
property tests for the base pagination invariants (canLoadMore mirrors
hasMore, load forwards limit/offset, item lookup).
By refactorer.