chore: sync develop → main (Phase 1.5 tooling + drop legacy .eslintrc.cjs)#65
Merged
chore: sync develop → main (Phase 1.5 tooling + drop legacy .eslintrc.cjs)#65
Conversation
Phase 1 spec §5 Issue 13 and §12 Block G call for an alpha-rehearsal-notes.md that captures friction during the Plata Mia end-to-end walk. Template seeds the structure — 8 journey steps + retro sections — so the rehearsal driver just fills each step with observations rather than improvising the structure on the day. Pre-conditions checklist at the top doubles as the Block G entry gate: develop→main merged, Railway redeployed, Supabase migrations applied, Dogfooding seeded, #27 and #28 resolved.
…l-notes docs(revamp): alpha-rehearsal-notes template for Block G
Injects a synthetic Polkadot-JS extension in the browser, backed by a real sr25519 keypair (//Alice), so the stadium-tester Skill can exercise SIWS-gated write flows in mock-mode preview URLs without a human signing step. Phase 1 spec §6 called this out as the biggest agentic-velocity blocker — six of the thirteen Phase 1 issues had Playwright-untestable write paths. Client: - testWalletInjection.ts: registers window.injectedWeb3['polkadot-js'] with a lazy enable() that derives //Alice and signs with pair.sign(). Double-gated: VITE_USE_TEST_WALLET=true AND !import.meta.env.PROD. Prod builds DCE the injection entirely (verified — __TEST_WALLET_ENABLED__ string not present in any dist/*.js chunk even with the flag set at build time). - main.tsx imports the injection at the top so it registers before React mounts and before AdminPage's 5s window.injectedWeb3 poll starts. - mockWinners.ts: Alice's SS58-42 address added as a team member on plata-mia-15ac43 so team-gated flows pass the client-side team check. - @polkadot/keyring added as explicit dep (was transitive via api/extension-dapp). Tester skill: - run-playwright.mjs: fixes a latent bug where specs/configs in /tmp couldn't resolve the bare '@playwright/test' specifier (ESM walks up from the importer's dir; /tmp has no node_modules). Rewrites spec imports and the generated config to use the absolute path under client/node_modules. This is why recent PRs' Playwright scenarios all shipped as unchecked boxes — the runner had never actually worked end-to-end. - @playwright/test promoted from "setup.sh installs on each machine" to an explicit devDep so fresh clones get it via npm install. - Forwards VITE_USE_TEST_WALLET through the Playwright spawn env. - SKILL.md: Test-wallet mode section documenting when/how to use it, which flows still can't run (admin-approval paths with no mock-mode branch in api.ts), and the hard prod-prohibition. - AGENT_GUIDE.md: Vercel Preview config note — VITE_USE_TEST_WALLET + Alice in VITE_ADMIN_ADDRESSES on Preview only, never Production. Verified locally: - cd server && npm test → 66/66 pass. - cd client && npm run build → clean. - harness check via real runner: 3/3 tests pass against http://localhost:8080 (VITE_USE_MOCK_DATA=true VITE_USE_TEST_WALLET=true npm run dev) — flag sentinel set, injection registered, enable() yields canonical Alice address 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY and produces a 0x-prefixed sr25519 signature. - prod-URL guard: exit 3 on https://stadium.joinwebzero.com, unchanged. - prod-build safety: VITE_USE_TEST_WALLET=true npm run build produces a dist with zero references to the injection sentinel — DCE works. Pre-existing lint (98 problems on develop, none introduced here) not fixed here — separate cleanup PR.
feat(tester): SIWS test-wallet harness (//Alice) + runner fix
Follow-up to PR #62 (SIWS test-wallet harness). The harness let Playwright sign SIWS writes, but `webzeroApprove`, `requestChanges`, and `confirmPayment` in api.ts still always hit the real API — which meant the tester couldn't drive Block F's admin-review loop end-to-end in mock mode. Adds `if (USE_MOCK_DATA)` branches mirroring the `submitM2Agreement` idiom: 500 ms delay, update `localStorage['projects']`, update the in-memory `mockWinningProjects` array, return `{ success: true }`. Behaviour matches what the server actually does: - webzeroApprove: sets `m2Status='completed'`, clears `changesRequested`. (webzeroApproved / webzeroApprovalDate are never read by any client code — not surfaced on the mock.) - requestChanges: sets `m2Status='building'`, stores `{feedback, requestedBy:'admin', requestedDate}` on `changesRequested`. - confirmPayment: full server-parity validation — milestone enum, positive amount, currency enum, transactionProof URL, BOUNTY→bountyName. Rejects duplicates (M1/M2 by milestone, BOUNTY by milestone+bountyName) with a 400 ApiError. Appends to `totalPaid`; on M2 also sets `m2Status='completed'` and `completionDate`. Verified via 5 Playwright tests driven through `.claude/skills/stadium-tester/ scripts/run-playwright.mjs`: - approve → m2Status flips to completed, changesRequested cleared - requestChanges → m2Status flips to building, feedback stored - confirmPayment M2 → totalPaid appended, m2Status completed, completionDate set - confirmPayment dup → 400 / "already been paid" - confirmPayment BOUNTY without bountyName → 400 / "bountyName is required" All 5 pass. `npm test` → 66/66, `npm run build` → clean. No new lint issues (`api.ts` already had two pre-existing `no-explicit-any` errors at 308/323 on develop; my additions add zero).
feat(client): mock-mode coverage for admin-approval flows
Before this: 98 problems (90 errors, 8 warnings) sitting on develop. Since
the only GitHub Actions workflow is `claude.yml`, nothing enforced it — so
`/pre-pr-check` couldn't distinguish new lint errors introduced by a PR from
pre-existing debt.
eslint.config.js:
- @typescript-eslint/no-explicit-any → off. 86 uses across the repo,
including Polkadot/SIWS shims and shadcn vendor code. The rule wasn't
enforced in practice. Dropping it matches the team's actual posture.
Revisit post-Phase-2.
- New overrides block for src/components/ui/**: disable
react-refresh/only-export-components. shadcn files co-export cva variants
alongside components; not ours to restructure.
tailwind.config.ts: require("tailwindcss-animate") → ESM import.
HomePage.tsx:98 + ProjectDetailsPage.tsx:331: narrow
`react-hooks/exhaustive-deps` disables with a one-line reason on each —
toast is stable, and adding fetchProject to deps would cause a fetch loop.
Both are the canonical "mount / route-keyed" effect pattern.
ProjectDetailsPage.tsx:66: /^[\-\•\*·]\s+/ → /^[-•*·]\s+/ (the escapes were
no-ops; first-position inside a character class doesn't need one).
After: `npm run lint` is clean (0 errors, 0 warnings) with the existing
`--max-warnings 0` enforcement preserved.
chore(client): make lint pass on develop (0 errors, 0 warnings)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sync
develop→mainso Railway (server) and Vercel (production client) pick up the three tooling PRs merged since the last sync (#60), plus a small cleanup.What this contains
Since the last develop→main sync (#60):
docs/alpha-rehearsal-notes.mdtemplate (Block G).//Alicesr25519 injection gated onVITE_USE_TEST_WALLET=true && !import.meta.env.PROD— DCE'd from prod builds (verified: sentinel string absent from alldist/assets/*.js). Runner bug fix (bare@playwright/testresolution from/tmp).@polkadot/keyring+@playwright/testpromoted to explicit deps.webzeroApprove,requestChanges,confirmPayment). All three gated byUSE_MOCK_DATA; real-API branches byte-identical to before.@typescript-eslint/no-explicit-any→ off (team's actual posture), shadcn vendor rule override, 2 narrow hook-dep disables with reasons, tailwindrequire→ ESMimport, regex escape cleanup.Small cleanup on top of the sync (this PR adds):
client/.eslintrc.cjs. ESLint 9 uses flat config (eslint.config.js); the.cjsfile has been inert since the upgrade. Flagged as a follow-up in chore(client): make lint pass on develop (0 errors, 0 warnings) #64.Prod-impact assessment
Low. None of the merged changes affect prod runtime behaviour:
!PROD) and statically DCE'd from prod builds. ProductionVITE_USE_TEST_WALLETmust stay unset; productionVITE_ADMIN_ADDRESSESmust not include Alice's address.USE_MOCK_DATA=true, which production leaves unset..eslintrc.cjswas already dead code (ESLint 9 ignores it wheneslint.config.jsexists).So this sync is effectively a deployment of tooling + housekeeping — no feature flags, no schema changes, no migrations.
Verification
Test plan
maincleanly (server has no relevant changes, but confirm no regression).main→/,/programs,/m2-program,/adminall render; prod bundle grep for__TEST_WALLET_ENABLED__returns 0 matches (DCE check).GET https://stadium-production-996a.up.railway.app/api/programsstill returns{ status: "success", data: [...] }— unchanged from current state (Dogfooding seed still pending).Follow-ups
developwill briefly still have.eslintrc.cjs. Either a tiny cleanup PR to develop, or the next sync naturally reconciles it.VITE_USE_TEST_WALLET=true+ Alice inVITE_ADMIN_ADDRESSESfor the harness to be useful on branch previews (tracked separately).