mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-client.git
synced 2026-09-21 16:52:02 -07:00
Move general-purpose truncateAddr/truncateTxid out of the feed-specific post-display module into src/util so the recent-profiles view depends on the shared utility layer rather than a sibling feature module. By architect.
3.3 KiB
3.3 KiB
Architectural Review Summary — reduce-dry-duplication
Task and commits reviewed
- Task:
reduce-dry-duplication - Source commit merged and reviewed:
eed9d70f6f(Reduce DRY duplication in services and components, from refactorer) - Reviewed as a batch via
ready_for_next.sh; merged intoswarmforge-architectas a fast-forward and processed.
Architectural findings and fixes applied
Reviewed the refactorer's DRY reduction for UI/Core separation, dependency rule, information hiding/encapsulation, and local code quality.
Findings (mostly sound, two notes):
- MemoDb service consolidation (
src/services/memo-db.js) —getRecentProfiles/getRecentPosts→getRecent, andgetProfile/getProfilePic/getName→getLevelResource. Preserves error semantics (recent → always throws; level → null on 404). Good cohesion, HTTP details stay in the service. No change needed. - AppUtil
pasteFromClipboard(src/util/index.js) — centralizes clipboard-paste into the shared utility; components no longer duplicate clipboard reading. Good information hiding. No change needed. PlaceholderViewextraction — shared placeholder used by placeholder2/3. Cohesive. No change needed.wallet-summaryblur toggle generalization —toggleBlur(field)via dynamic setter name reduces duplication. Functional and correct; the dynamicset${Capitalized}construction is a mild readability tradeoff but acceptable to preserve the DRY intent. No change.- Cross-feature dependency (fixed) —
recent-profilesimported the general-purposetruncateAddr/truncateTxidfrom the feed-specificpost-feed/post-display. For cohesion and dependency direction, these pure string helpers belong in the shared utility layer. Applied fix: movedtruncateAddr/truncateTxidtosrc/util/index.js;post-displaynow imports from util and re-exports them for its existing consumers;recent-profilesimports directly fromsrc/util. This removes a sibling-feature → sibling-feature module coupling and keeps generic display helpers in the shared utility.
Verification results
- Mutation (
mutate4javascript --scan): memo-db.js 4 sites, util/index.js 6 sites, post-display.js 8 sites. No JS unit test suite exists in this project (npm test→echo 'no tests'); there is no coverage harness, so all sites are uncovered and no survivors can be killed by tests. JSX component files cannot be parsed by the mutation tool (nojsxBabel plugin); they are UI adapters and are outside the currently testable boundary. - DRY (
dry4javascript src): no duplicate candidates found — the reduction is effective and my fix introduced no duplication. - Gherkin acceptance mutation (soft): not runnable — this project has no
.featurefiles, no acceptance pipeline, and no runner adapter. - Property tests: none present in this project.
Suite status
- No JavaScript unit/acceptance suite exists (
npm testechoes "no tests"). bb.edntest task covers the swarmforge helper scripts only (unrelated to this UI work).
Handoffs sent
git_handoff→ coder, refactorer (priority00, taskreduce-dry-duplication), to review the architectural commit.
By architect.