mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-client.git
synced 2026-09-21 16:52:02 -07:00
Add a unit test for the broadcast-error message fallback to kill the last new-post mutant, and commit the differential and acceptance mutation manifests written by the approved tools during the architect verification pass for the new-post-errors feature. By architect.
3.4 KiB
3.4 KiB
Architectural Review Summary — new-post-errors
Task and commits reviewed
- Task:
new-post-errors - Reviewed the merged branch ending at
66a684923c(refactorer), which carried:a125751/4e0f40c— specifier broadcast-error surfacing spec (specs/memo-new.featurescenario 6)164bdb3— coder implementation (surface broadcast errors on the new post page)66a6849— refactorer failure-handling refactor + property coverage
- 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.
- Failure classification (good).
src/services/new-post.js_handleSubmitFailurecleanly separates local validation failures (submitError=memo_validation/memo_length) from broadcast/handler failures (surfaced viabroadcastErrorand abroadcastsubmit state). The controller stays on the page on failure; the UI component surfaces the real message. Injection ofmemoPost/navigatekeeps it free of UI/IO concerns; dependency direction is inward. - Unified handlers extended (good).
acceptance/lib/handlers.jsadds awallet fails to broadcaststep, aremain on pathassertion, andattempts to broadcast/shows an error containingpatterns without duplicating step logic; the two features share oneworld.newPage. - Property coverage (good). A seeded property asserts a broadcast failure never
navigates and always surfaces a
broadcastsubmitError with the real error text. - Fix applied — error-message fallback coverage. The language mutation tool
surfaced one survivor on
new-post.js:87(err.message || String(err)→&&), which only matters whenerr.messageis falsy. No test exercised that path. Added a unit test where a broadcast throws an empty-messageErrorand asserts the string form is surfaced, killing the mutant.
Verification results
- Unit (
node --test): 21/21 pass (added the empty-message fallback test). - Property (
npm run test:property): 7/7 pass. - Acceptance (normal): both
memo-newandpost-memogenerated suites pass, including scenario 6 (broadcast error surfaced, user stays on page). - Mutation (
mutate4javascript,--max-workers 8,--mutate-all):new-post.js— killed 12 / survived 0 / uncovered 0 (was 1 survivor before the fix). - DRY (
dry4javascript src): no duplicate candidates. - Gherkin acceptance mutation (soft):
memo-new.feature— 14 executed, 4 killed, 10 survived, 0 errors (1 previously-killed empty-memo scenario reused).- Killed: character-counter
countvalues and the empty-memo boundary — values are behaviorally connected. - Survived (documented equivalents): message-text dithers and broadcast-error-text dithers; these are opaque data or substring-consistent with the surfaced error, so they do not change the exercised branch.
- Killed: character-counter
- Property tests run separately via
npm run test:property.
Suite status
- Unit + property + acceptance all pass; source-level mutation fully kills both testable core modules. Gherkin acceptance mutation survivors are documented equivalents.
Handoffs sent
git_handoff→ coder, refactorer (priority00, tasknew-post-errors), to review the architect commit (fallback coverage + tool manifests).
By architect.