Handoffs sit undelivered when handoffd is not running, and recovery was a
manual step. Add ensure_handoff_daemon.sh and call it from swarm_handoff.sh
and ready_for_next.sh so the daemon is restarted whenever it is missing.
By specifier.
Each psf-memo-db acceptance scenario opened an isolated LevelDB directory
but close() only closed the handles, so tmp/acceptance grew without bound
(found at 961 dirs / 293 MB). Delete the scenario dir in close() and sweep
tmp/acceptance at the start of the acceptance run.
By specifier.
The architect's terminal handoff went only to coder and refactorer, so the
specifier never received a merge notification and a human had to bridge the
gap. Require an end-of-chain git_handoff to the specifier for every completed
task or batch, including manifest- and metadata-only churn.
By specifier.
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.
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.
Extract validVideoId, parseCandidate, videoIdFromWatchUrl,
videoIdFromShortUrl, and pushText helpers to lower cyclomatic
complexity of extractYouTubeVideoId and parsePostText to <= 6.
By refactorer.
- 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.
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.
Pin the profile wallet-address selector invariants over broad input
space: reactive-state precedence, wallet fallback, and null-on-absent.
CRAP (3.0), DRY, and mutation scan assessed; no split needed and no
manifests discarded.
By refactorer.
Merged the refactorer's notifications-query property-test suite and reviewed
it architecturally. Property tests are well-placed in test/property/, reuse
the shared harness, and the independent buildExpected oracle traces 1:1
against the production aggregation/sort/pagination. No production source
changed. Verification: 39 property tests pass, 315 unit tests pass, lint
clean, mutation differential 0/0/0 (no regression), DRY no candidates,
soft Gherkin mutation 0 killed / 16 intrinsic equivalents.
By architect.
Use the reactive bchWalletState.cashAddress as the viewer address source
and include it in the profile load effect dependencies. Extract a small
wallet-address selector so the behavior is unit-testable.
By coder.
Pin the NotificationsQuery aggregation invariants over broad random
inputs: newest-first ordering with seen tie-break, global ordering, and
pagination conservation. Coverage, CRAP (max 6.0), DRY, and mutation
scan were assessed; all changed/new source files are well under the
100-site split threshold and mutation manifests are preserved.
By refactorer.
Record the tmp/acceptance and target/mutation-workers bloat that made
mutate4javascript worker copies many GB and mutation runs appear to hang.
Add a startup check that flags any of these dirs over 100MB so they are
cleaned before a mutation run.
By architect.
Extract the post-lookup-with-null helper into a shared module used by both
the notifications and post query adapters, removing duplication. Add a
dedicated NotificationsQuery unit suite (26 tests) and hardening tests that
kill the sort-comparator and followee-guard mutations. Refresh mutation
manifests via the approved tool. Document 5 intrinsic mutation equivalents
and 16 soft-Gherkin equivalents in the review summary.
By architect.
Extract the reply-notification predicate from
_collectReplyNotifications into a _replyNotificationChild helper, moving
the txid-presence guard into the loop so both functions drop to CRAP 5.
Add mutation manifests for the new notifications-query, list-notifications,
and notifications-page modules via the approved tool.
By refactorer.