Commit Graph
199 Commits
Author SHA1 Message Date
Chris Troutner 2bcc965efb Review feed-query-performance: remove dead full-scan methods, harden mutation coverage
Remove the full-scan methods the capped-scan optimization replaced
(topLevelPostTxids, countTopLevelPosts, countTopLevelPostsByAddr,
buildReplyCountMap) and their tests, keeping the backwards-compat wrappers.
Add hardening tests to kill 4 mutation survivors (raw scan bound, viewerAddr
fallback). Refresh mutation manifests and Gherkin acceptance-mutation stamps.

By architect.
2026-09-04 18:59:27 -07:00
Chris Troutner 2455745d97 Reduce CRAP in capped-scan recent feed query
Extract reply/mute eligibility check into PostQuery.isEligibleRecentPost,
lowering scanRecentPostTxidsAndCount CRAP from 7 to 6. Refresh mutation
manifest.

By refactorer.
2026-09-04 18:16:10 -07:00
Chris Troutner 65e85c9aef Implement capped-scan feed query performance for /posts/recent
- 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.
2026-09-04 17:55:35 -07:00
Chris Troutner df39b47eb1 Spec feed query performance: per-page reply counting and capped total scan
By specifier.
2026-09-04 17:36:26 -07:00
Chris Troutner 09e5981353 Update backlog and briefing after mute-feed-filtering merge
By specifier.
2026-09-04 13:55:16 -07:00
Chris Troutner 3992395480 Review mute-feed-filtering: fix mute dependency order and follow-key fallback, add helper coverage
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.
2026-09-04 13:35:02 -07:00
Chris Troutner a2e0b7691b Refactor mute filtering onto shared helper, reduce CRAP, add property coverage
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.
2026-09-04 12:34:35 -07:00
Chris Troutner bdf1de97bd Merge mute-feed-filtering coder changes 2026-09-04 12:23:32 -07:00
Chris Troutner 448bddc31f Implement mute feed filtering across recent, topic, search, and notifications feeds
By coder.
2026-09-04 12:23:00 -07:00
Chris Troutner c8ef2ddd95 Spec mute feed filtering across recent, topic, search, and notifications feeds
By specifier.
2026-09-04 12:09:02 -07:00
Chris Troutner b9d2be63ed Update briefing and backlog after binary-payload-broadcast merge
By specifier.
2026-09-04 11:34:03 -07:00
Chris Troutner 984e691006 Merge architect branch for binary-payload-broadcast
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.
2026-09-04 11:31:54 -07:00
Chris Troutner 167a64ae6b Review binary-payload-broadcast: verify MemoStateAction dedup, document Gherkin equivalents
By architect.
2026-09-04 11:30:12 -07:00
Chris Troutner 53f6b90f56 Deduplicate Memo follow/mute onto shared MemoStateAction base
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.
2026-09-04 11:25:28 -07:00
Chris Troutner 8d40f2bdcd Merge binary-payload-broadcast coder changes
By refactorer.
2026-09-04 11:13:40 -07:00
Chris Troutner 5e1f4739e3 Broadcast follow/mute/unfollow/unmute hash160 payloads as Uint8Array
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.
2026-09-04 11:13:15 -07:00
Chris Troutner f741119d8e Merge specifier binary-payload-broadcast spec
By coder.
2026-09-04 11:08:22 -07:00
Chris Troutner 62e04799c8 Specify binary hash160 broadcast payload for follow/mute
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.
2026-09-04 11:07:25 -07:00
Chris Troutner 5602975a37 Update briefing and backlog after page-size-50 merge
By specifier.
2026-09-04 10:54:33 -07:00
Chris Troutner cfe67110ca Merge architect branch for page-size-50
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.
2026-09-04 10:52:28 -07:00
Chris Troutner feabfd43f8 Merge commit 'a4cd814931' into swarmforge-coder 2026-09-04 10:46:14 -07:00
Chris Troutner a4cd814931 Review page-size-50: harden pagination null edge, document equivalents
By architect.
2026-09-04 10:45:35 -07:00
Chris Troutner a9488d9ae2 Refactor paginated pages onto shared base, add property coverage
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.
2026-09-04 10:06:27 -07:00
Chris Troutner bf51558800 Merge commit '7ca73cffdc' into swarmforge-coder 2026-09-04 10:00:45 -07:00
Chris Troutner 38f7a42b90 Merge commit '59cce4426d' into swarmforge-refactorer 2026-09-04 10:00:44 -07:00
Chris Troutner 59cce4426d Reduce paginated client page size to 50
By coder.
2026-09-04 10:00:19 -07:00
Chris Troutner 7ca73cffdc Review youtube-embed property tests, document equivalents
By architect.
2026-09-04 09:50:19 -07:00
Chris Troutner 5117e6537b Merge commit '9ec8760b59' into swarmforge-architect 2026-09-04 09:48:00 -07:00
Chris Troutner 81cedabcdf Specify 50-item page size for all paginated pages
By specifier.
2026-09-04 09:47:47 -07:00
Chris Troutner 9ec8760b59 Add property tests for youtube-embed parser invariants
Cover round-trip reconstruction, segment shape, non-YouTube URLs staying
text, and video-id round trips over broad random inputs.

By refactorer.
2026-09-04 09:43:51 -07:00
Chris Troutner 73c937d6b0 Use dry4javascript --help in startup smoke check
By architect.
2026-09-04 09:41:06 -07:00
Chris Troutner 0dba837238 Update briefing and backlog after youtube-embed merge
By specifier.
2026-09-04 09:38:04 -07:00
Chris Troutner b63019c31f Review youtube-embed: harden parser edge cases, document equivalents
Add unit tests for invalid video id and non-/watch youtube.com URL to
kill mutation survivors; document the match[1]/match[0] equivalent and
the soft-Gherkin example-value equivalents.

By architect.
2026-09-04 09:28:13 -07:00
Chris Troutner 93baa25ad0 Reduce CRAP in youtube-embed parser
Extract validVideoId, parseCandidate, videoIdFromWatchUrl,
videoIdFromShortUrl, and pushText helpers to lower cyclomatic
complexity of extractYouTubeVideoId and parsePostText to <= 6.

By refactorer.
2026-09-04 09:19:18 -07:00
Chris Troutner b478d132fe Merge commit '8e606aecb1' into swarmforge-refactorer 2026-09-04 08:51:05 -07:00
Chris Troutner 8e606aecb1 Implement YouTube embed rendering in recent posts feed
By coder.
2026-09-04 08:50:28 -07:00
Chris Troutner 146685434e Specify YouTube embed in posts
By specifier.
2026-09-04 08:43:41 -07:00
Chris Troutner 4eea327f60 Reduce CRAP and DRY in psf-memo-db
- Add tests for profile/level handleError to raise coverage
- Extract DbBackup pure helpers into testable db-backup-util module
- Add tests for DbBackup zip/unzip and the pure helpers
- Extract shared handleControllerError helper across 7 REST controllers

By refactorer.
2026-09-04 07:52:19 -07:00
Chris Troutner 15d7491a69 Merge architect topics-most-recent-order review
By specifier.
2026-09-04 07:33:22 -07:00
Chris Troutner 5bb2906d92 Review topics-most-recent-order: hide lastHeight ordering key, harden height-0 cases
By architect.
2026-09-04 07:25:44 -07:00
Chris Troutner 57915081c6 Update listTopics property test comment to reflect most-recent-post ordering
By refactorer.
2026-09-04 06:59:50 -07:00
Chris Troutner f7647c70f4 Merge commit 'f45f2f9e2a' into swarmforge-refactorer 2026-09-04 06:43:42 -07:00
Chris Troutner f45f2f9e2a Order GET /topics by most recent post
By coder.
2026-09-04 06:43:28 -07:00
Chris Troutner 5bc61c76d9 Merge specifier topics-most-recent-order spec\n\nBy coder. 2026-09-04 06:39:53 -07:00
Chris Troutner bc07eda916 Spec GET /topics ordering by most recent post
By specifier.
2026-09-04 06:39:31 -07:00
Chris Troutner 2a3e742532 Pass appData to Profile route so Follow/Mute buttons receive the wallet
By specifier.
2026-09-03 21:44:01 -07:00
Chris Troutner 0613aa4a29 Merge profile-wallet-connect review from architect
By refactorer.
2026-09-03 16:19:15 -07:00
Chris Troutner c0893d36cd Merge architect profile-wallet-connect review
By coder.
2026-09-03 16:19:09 -07:00
Chris Troutner fdd13ef734 Review profile-wallet-connect: confirm selector, fix gherkin-parser wrapper
Reviewed the refactorer's profile-wallet-connect work. getViewerAddress is a
clean pure selector (reactive-then-wallet precedence, null-on-absent); the
profile index.js wiring fix is sound and correctly re-loads when the address
becomes available. Fixed swarmforge/scripts/gherkin-parser, which delegated to
a non-existent .swarmforge/tools/aps path, to use the established tmp/aps-spec
checkout. Added the mutation differential-manifest for the new module.
Verification: 243 client unit + 33 property tests pass, lint clean,
mutation 2 killed / 0 survived, DRY no candidates, soft Gherkin mutation
6 intrinsic equivalents.

By architect.
2026-09-03 16:19:00 -07:00
Chris Troutner 2bd9af5a1b Merge commit '5c6bffd6de' into swarmforge-architect 2026-09-03 16:15:35 -07:00