mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo.git
synced 2026-09-21 16:52:01 -07:00
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.
3.5 KiB
3.5 KiB
Profile Wallet Connect — Architectural Review Summary
Task: profile-wallet-connect
Commits reviewed: c294617 (profile Follow-button wiring fix), 8592db3
(gherkin-parser wrapper), 5c6bffd6de (getViewerAddress property tests),
merged on the architect branch
By: architect
Scope
Reviewed the refactorer's profile-wallet-connect feature across
psf-memo-client: the new pure selector src/services/profile-wallet.js, its
unit and property test suites, the profile page index.js wiring fix (Follow /
Mute button address source), and a new swarmforge/scripts/gherkin-parser
convenience wrapper.
Architectural findings and fixes applied
getViewerAddressis a clean single-responsibility selector. It prefers the reactivebchWalletState.cashAddress, falls back towallet.walletInfo.cashAddress, and returnsnullwhen neither is present. Pure, dependency-free, trivially testable. The property-test oracle (expectedGet) and the four unit tests trace exactly to the source's precedence rule — traced line-by-line and consistent.index.jswiring fix is sound. The Follow/Mute button address now comes fromgetViewerAddress(reactive-then-wallet) instead of onlywallet.walletInfo.cashAddress, so the button appears once the reactive wallet state loads.myAddr,wallet, andappProfileswere extracted as locals and added to the effect dependency array, so the profile re-loads when the address becomes available. Component delegates address selection to the pure helper; dependency direction is correct (core helper ← component, no reverse coupling).- Fixed a broken convenience script.
swarmforge/scripts/gherkin-parserdelegated to.swarmforge/tools/aps, a path that did not exist anywhere in the monorepo (the established APS checkout is./tmp/aps-spec, perdocs/architect-startup.mdandarchitect-startup.sh). Corrected it totmp/aps-specand verified it now emits valid parser JSON. - Mutation manifest added for the new module. The language mutation tool
recorded a differential-mutation baseline for
profile-wallet.js(getViewerAddress fully covered, 2/2 mutants killed). Preserved so future runs can detect source drift. - Test/property separation respected: property tests live in
test/property/, reuse the shared clientharness.js, and are run via the dedicatedtest:propertycommand.
Verification results
- Client unit tests: 243 passing, lint clean.
- Client property tests (
test:property): 33 passing (incl. 3 newgetViewerAddressprecedence/fallback/absence properties). - Language mutation (
mutate4javascript,--max-workers 8,src/services/profile-wallet.js): Killed 2, Survived 0, Uncovered 0. - DRY (
dry4javascript):No duplicate candidates found. - Soft Gherkin acceptance mutation (
follow-user.feature --level soft): Total 6, Killed 0, Survived 6, Errors 0. All six are single-character case mutations of the exampleaddr(a cash address used identically on the setup and assertion sides of each scenario) — intrinsic equivalents, not chased.
Suite status
psf-memo-client: unit 243 passing, property 33 passing, lint clean.- The standalone React smoke test (
src/App.test.js) is not part of the project'snpm testglob and requires react-scripts/jsdom; it is unrelated to this change (same as the memo-db.js/adapter exclusion precedent).
Handoffs sent
git_handoffto coder and refactorer (priority: 00) with the merge/review commit for follow-up review.