mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-client.git
synced 2026-09-21 16:52:02 -07:00
Review the reply-memo feature (specifier spec, coder implementation, refactorer test extraction). Kill two mutation survivors by adding tests for the hexToBytes length check and the reply page successPath wiring. Refresh mutation and acceptance mutation manifests from verification runs. By architect.
5.2 KiB
5.2 KiB
Architectural Review Summary — reply-memo
Task and commits reviewed
- Task:
reply-memo - Reviewed the merged branch ending at
b4508e8909(refactorer), which carried:8294b4d— specifier Reply to a Memo Gherkin spec (specs/reply-memo.feature)230618d— specifier browser fix: replace Node-onlyBuffer.byteLengthwith a TextEncoder-based UTF-8 byte helper (src/services/utf8.js) so the Set Name byte counter works in the browserd33fda8— coder implementation (MemoReply,ReplyThreadPage,utf8, acceptance handlers)b4508e8— refactorer extraction of reply tests into the shared helpers
- Merged into
swarmforge-architect(merge commitc0e4eba) and processed as a batch.
Architectural findings and fixes applied
Reviewed UI/Core separation, dependency rule, information hiding/encapsulation, and local code quality.
- UI/Core separation (good). All reply behavior lives in testable services
(
memo-reply.js,reply-thread-page.js) free of UI/IO; the wallet and thread are injected behind small adapter boundaries.utf8.jsis a shared, browser-safe byte-length helper that fixes a real browser bug (NodeBufferis unavailable in the browser) and is reused by both the Set Name and Reply slices. - Dependency rule (good).
memo-replydepends inward onmemo-actionandutf8;reply-thread-pagedepends inward onpage-controller,memo-reply, andutf8. No low-level module reaches toward IO. - Information hiding (good).
MemoReplyextendsMemoActionand supplies the reply-specificconfig,isTooLong, andreflect; it overridesreply()to build the raw wire payload (32-byte parent txid + UTF-8 text) because the reply wire format differs from the plain-value broadcast.ReplyThreadPageextendsPageControllerand suppliessuccessPath,validationCodes,_setBusy, and_perform, plus asetParentfor nested replies. ThehexToBytes/buildReplyPayloadhelpers are module-private, keeping the wire format hidden. - Test refactoring (good). The refactorer extended
memo-action-helpers(extraextraArgsfor the parent txid,byteBasedmulti-byte tests,assertBroadcastMsg) and addedregisterPageSubmitTeststopage-controller-helpers, so the reply tests reuse the shared registrars instead of duplicating them. Helpers stay separate from.test.jsfiles. - Fix applied — mutation survivors (2). The language mutation tool flagged two
|| -> &&survivors that were equivalent only because of test gaps:memo-replyhexToBytes: the 64-character length check was unobservable because the only invalid-txid test used a non-hex string that the hex-parse loop also rejected. Added a test that a wrong-length but valid-hex txid is rejected with the length error, killing the mutation.reply-thread-pageconstructorsuccessPath: the page was never constructed with asuccessPath, so the|| -> &&wiring was unobservable. Added a test that a configured success path is honored (navigates on success), killing the mutation. Both tests are behavior-preserving and close real coverage gaps.
Verification results
- Unit (
node --test): 86/86 pass (was 84; +2 survivor-killing tests). - Property (
node --test test/property/*.test.js): 13/13 pass. - Acceptance (normal):
memo-new,post-memo,set-name, andreply-memogenerated suites all pass (4 suites). - Mutation (
mutate4javascript,--max-workers 8,--mutate-all):- memo-action 5/0/0, memo-post 2/0/0, memo-set-name 2/0/0, memo-reply 8/0/0, page-controller 7/0/0, new-post 4/0/0, set-name-page 3/0/0, reply-thread-page 5/0/0, account-page 7/0/0, profiles 1/0/0, utf8 0/0/0 (no mutation sites).
- All testable core modules fully kill; no survivors, no uncovered. The two
|| -> &&survivors were killed by the added tests.
- DRY (
dry4javascript srcanddry4javascript test): no duplicate candidates in either tree. - Gherkin acceptance mutation (soft):
reply-memo.feature— 13 executed, 5 killed, 8 survived, 0 errors.memo-new.feature— 14 executed, 4 killed, 10 survived, 0 errors.post-memo.feature— 5 executed, 0 killed, 5 survived, 0 errors.set-name.feature— 13 executed, 6 killed, 7 survived, 0 errors.- Killed: byte/char
countdithers and the empty-value boundary — values are behaviorally connected to the counter and rejection branches. - Survived (documented equivalents): message/name/broadcast-error text dithers are opaque data — any non-empty value broadcasts and reflects identically, so the mutation does not change observable behavior.
Suite status
- Unit + property + acceptance all pass; source-level mutation fully kills all testable core modules. Gherkin acceptance mutation survivors are documented equivalents.
Handoffs sent
git_handoff→ coder, refactorer (priority00, taskreply-memo), to review the architect commit (survivor-killing test additions + refreshed tool manifests).- No handoff to the specifier: the architect produced no functional feature commit (the reply-memo feature was implemented by the coder and already spec-approved).
By architect.