mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-client.git
synced 2026-09-21 16:52:02 -07:00
Move per-action config into a static config object on MemoPost and MemoSetName and have the MemoAction base constructor read it, eliminating the DRY-flagged duplicate constructor pattern. Commit the differential and acceptance mutation manifests written by the approved tools during the architect verification pass for the set-name feature. By architect.
4.5 KiB
4.5 KiB
Architectural Review Summary — set-name
Task and commits reviewed
- Task:
set-name - Reviewed the merged branch ending at
d79b9f04bd(refactorer), which carried:bb9d00a— specifier Set Name Gherkin spec (specs/set-name.feature)bd2eac5— coder implementation (MemoSetName, SetNamePage, AccountPage, Profiles store, React views, acceptance handlers)d79b9f0— refactorer extraction ofMemoActionandPageControllerbase classes plus set-name property tests
- Merged into
swarmforge-architect(fast-forward) and processed as a batch.
Architectural findings and fixes applied
Reviewed UI/Core separation, dependency rule, information hiding/encapsulation, and local code quality.
- Base-class extraction (good).
MemoAction(shared byMemoPostandMemoSetName) ownsvalidate/broadcast/_throwIfInvalid; subclasses supply only the protocol-specificisTooLong/reflectand their config.PageController(shared byNewPostPageandSetNamePage) ownssetInput/submit/_handleSubmitFailure; subclasses supplysuccessPath,validationCodes,_setBusy, and_perform. This removes structural duplication between the two memo actions and the two page controllers while keeping dependency direction inward. - UI/Core separation (good). All behavior lives in testable services free
of UI/IO; the React views (
set-name,account,app-body,nav-menu) are thin shells that inject wallet/profiles/navigate adapters. The sharedProfilessession store keeps the Set Name and Account pages in sync without leaking persistence structures across the boundary. - Acceptance handlers (good).
acceptance/lib/handlers.jsuses regex parameter capture as the default style and shares oneworldacross the memo-post, new-post, set-name, and account features; the fake walletsendOpReturnsignature was corrected to the public minimal-slp-wallet API. - Fix applied — constructor duplication (DRY). The language DRY tool
flagged a score=1.00 duplicate between the
MemoPostandMemoSetNameconstructors (identical config-assignment shape). Moved the per-action config into a staticconfigobject on each subclass and had the baseMemoActionconstructor readthis.constructor.config. This eliminates the duplicate constructor pattern while keeping the config values subclass-specific and readable. DRY now reports no duplicate candidates.
Verification results
- Unit (
node --test): 56/56 pass. - Property (
npm run test:property): 13/13 pass (set-name validation classification, byte-counter conservation, setInput round-trip, broadcast failure never navigates). - Acceptance (normal):
memo-new,post-memo, andset-namegenerated suites all pass (11 + 6 + 11 scenarios). - Mutation (
mutate4javascript,--max-workers 8,--mutate-all):memo-action.js— killed 5 / survived 0 / uncovered 0memo-post.js— killed 2 / survived 0 / uncovered 0memo-set-name.js— killed 2 / survived 0 / uncovered 0page-controller.js— killed 7 / survived 0 / uncovered 0set-name-page.js— killed 3 / survived 0 / uncovered 0account-page.js— killed 7 / survived 0 / uncovered 0profiles.js— killed 1 / survived 0 / uncovered 0new-post.js— killed 0 / survived 0 / uncovered 0 (manifest current)- Manifests refreshed for all refactored/new files.
- DRY (
dry4javascript src): no duplicate candidates (constructor duplication removed). - Gherkin acceptance mutation (soft):
set-name.feature— 13 executed, 6 killed, 7 survived, 0 errors (1 scenario/1 mutation reused from the clean empty-name scenario).- Killed: byte-counter
countvalues and the empty-name boundary — values are behaviorally connected. - Survived (documented equivalents): name-text dithers (m1, m2, m10) are opaque data — any non-empty name broadcasts and reflects identically; and over-length name dithers (m4, m5, m6, m14) remain over-length, so the length-rejection and zero-count branches are unchanged.
- Killed: byte-counter
- Property tests run separately via
npm run test:property.
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, taskset-name), to review the architect commit (constructor DRY fix + refreshed tool manifests).
By architect.