Issue: #664 UI-FE-093
Protocol Authority Reference: DigiNodes/truthbounty-protocol @ commit 60c66b78cf797d8f821089c99ae1bc461009fecc
Frontend Implementation Matrix: 58 Approved High-Fidelity Boards across 6 Protocol Batches
Branch: main
Frontend pull requests previously risked allowing visual drift to silently bypass component-level tests because there was no deterministic mechanism connecting implemented routes, views, and canonical states back to the authoritative high-fidelity boards defined in the protocol repository.
This implementation delivers an end-to-end conformity review pipeline and visual evidence harness for DigiNodes/truthbounty-frontend, enforcing strict alignment across all 58 approved protocol boards spanning 6 logical batches.
- File:
src/config/board-conformity-manifest.json - Typed Interface:
src/config/board-conformity.ts - Coverage: Exhaustively indexes all 58 approved boards:
- Batch 1 (Foundation): 8 boards (
INDEX-001,INDEX-002,DASH-001,DASH-002,DASH-003,DASH-004,SEARCH-001,ERR-001) - Batch 2 (Public-Claimant): 11 boards (
CLAIM-001throughCLAIM-007,PROFILE-001,PROFILE-002,CLAIMANT-001,CLAIMANT-002) - Batch 3 (Verifier): 7 boards (
VERIF-001throughVERIF-007) - Batch 4 (Dispute): 6 boards (
DISP-001throughDISP-006) - Batch 5 (Privileged): 13 boards (
ADMIN-001throughADMIN-008,MOD-001throughMOD-005) - Batch 6 (Support-Legal): 13 boards (
HELP-001throughHELP-004,DOCS-001throughDOCS-003,LEGAL-001throughLEGAL-004,AUDIT-001,SEC-001)
- Batch 1 (Foundation): 8 boards (
- Viewport Matrix: Desktop (
1440x900), Tablet (768x1024), Mobile (375x667), and Zoom 200% (640x900at CSS device scale factor 2.0). - Explicit Blocked/Unavailable Records: Every board not yet fully mounted in frontend route trees (
plannedorunavailable) contains an authoritativeblockedReason(e.g. pending backend RPC or smart contract migration), satisfying the zero-unaccounted-screen invariant.
- File:
e2e/board-conformity.spec.ts - Deterministic Capture:
- Mock wallet/session state (
truthbounty_test_session,truthbounty_test_wallet) injected prior to page loads. - Animations disabled (
reducedMotion: 'reduce', CSS animation/transition zeroing, font smoothing normalization). - Fixed virtual clocks and deterministic mock data.
- Zero root horizontal overflow assertion (
scrollWidth <= clientWidth + 1). - Accessibility checks executed alongside captures using
@axe-core/playwright.
- Mock wallet/session state (
- File:
playwright.visual-conformity.config.ts - Threshold Enforcement:
- Standard diff pixel ratio:
maxDiffPixelRatio: 0.002(0.2%). - Upper hard limit:
0.005(0.5%). Any threshold above 0.005 is rejected automatically. - Dynamic masks for non-deterministic elements (block hashes, live timestamps, wallet balances, streaming IDs).
- Standard diff pixel ratio:
- File:
scripts/verify-board-conformity.mjs - Outputs:
- Machine-readable evidence bundle:
reports/board-conformity-bundle.jsonwith SHA-256 digest. - Human-readable reviewer summary:
reports/board-conformity-summary.md.
- Machine-readable evidence bundle:
- Security Check: Embedded secret scanner ensuring zero private keys, MNEMONIC phrases, or personal user data are written to bundles.
- File:
docs/BOARD_CONFORMITY_REVIEW_GUIDANCE.md - Contents:
- Normative review instructions for PR approvers.
- Invariant rules (e.g. accessibility primacy over pixel matches, 44×44px touch targets).
- Explicit variance lifecycle requiring documented rationale, approval tickets, and expiration milestones.
| Constraint | Enforcement Mechanism |
|---|---|
| Pixel similarity cannot override accessibility or authoritative live state | Both unit tests and E2E harness run axe accessibility evaluations concurrently with visual snapshotting; tests fail if WCAG 2.1 AA violations occur even with 100% visual match. |
| Approved responsive behavior matters more than literal desktop scaling | Capture harness tests 4 viewports including Mobile (375x667) and Zoom 200% (640x900), enforcing zero root horizontal scroll overflow and responsive drawer behavior. |
| Variances require review; they must not be silently accepted | Any knownVariances entry requires varianceId, description, justification, and approvedBy. Unapproved drift triggers validation failure. |
| Missing route/state/viewport entries fail the evidence job | verify-board-conformity.mjs validates 100% presence of all 58 boards, all 4 viewports, and canonical states. |
| Masked regions and threshold changes require code review | Masks must map to valid CSS selectors; thresholds above 0.005 are hard-rejected; threshold changes modify the manifest, forcing git review. |
| Link bundles from implementation PRs without committing secrets | Automated regex scanner inspects all bundle fields for cryptographic keys and secrets before bundle emission. Bundle stored as CI artifact. |
npm run verify:board-conformity:bundleResult:
- Verified all 58 protocol boards across 6 batches.
- Secret scan clean (0 leaks).
- Bundle SHA-256 digest:
98f419109c89c04992a215971774a5486fea2af629267bf1d02b219ee7a26d32.
node --test scripts/__tests__/verify-board-conformity.test.mjsResult: 14 passed, 0 failed.
- Extracts exactly 58 approved boards from protocol route authority.
- Validates clean production manifest.
- Rejects missing authority boards, unauthorized boards, and unpinned commits.
- Rejects missing viewports, missing canonical states, and excessive thresholds.
- Rejects non-implemented screens lacking explicit
blockedReasonrecords. - Rejects undocumented variances.
- Validates secret detector catches simulated keys.
- Confirms bundle determinism and markdown summary emission.
npx jest src/__tests__/design-system/board-conformity.test.tsxResult: 17 passed, 0 failed.
- Confirms 58-board authority mapping and 6-batch distribution.
- Confirms canonical routes map to approved boards.
- Confirms WCAG 2.1 AA compliance (zero violations via
jest-axe) on all canonical system states (loading,empty,stale,offline,unavailable,error,denied,not-found,AccessDeniedState,ApiStaleBanner,RouteErrorFallback).
Updated .github/workflows/ci.yml:
- Added
board-conformityjob executingnpm run verify:board-conformity:bundle. - Uploads
reports/as a 30-day workflow artifact (board-conformity-evidence-bundle). - Added
board-conformitytoe2ejob dependencies, blocking merges if conformity fails. - Integrated
verify:board-conformityintoprebuildinpackage.jsonto prevent building out-of-sync bundles.