Repository navigation
feat: unified CI pipeline, complete TypeORM entity registry, wallet signing security fixes - #871
Merged
mercy60 merged 4 commits intoOct 23, 2026
Conversation
- Rewrite AppModule with deduplicated imports and autoLoadEntities=true so every feature module's TypeOrmModule.forFeature entities are registered, resolving "most feature repositories cannot resolve metadata". - Add missing module imports (Auth, Admin, UserInventory, Badge, Wallet, Reports, PuzzleCategory, Rewards, Challenge) so their repositories wire up. - Resolve table-name collisions (users/badges/puzzles) by renaming the duplicate entity classes (user_inventory_users, user_inventory_badges, gm_users) and canonicalizing referral entities onto the auth User. - Create GameMechanicsModule to register the gameMechanics entity subgraph. - Add forFeature([Report]) to ReportsModule. - Fix database.config.ts to return real booleans (string 'false' was accidentally truthy, enabling synchronize and autoload incorrectly). - Restore main.ts as a real NestJS bootstrap (it was a corrupted copy of AppModule), with CORS and global validation pipe. - Fix truncated user-settings.service.spec.ts and spun up missing DTO/index files (create-user-ranking.dto, user-ranking/index, auth.guard, etc.). - Install missing deps (@nestjs/jwt, @nestjs/swagger, passport-local, @types/passport-local, ethers, @nestjs/axios) and fix typings so `nest build` (tsc) passes with zero non-spec errors. Co-authored-by: openhands <openhands@all-hands.dev>
- Delete stale app/page.tsx (link-accounts page) that was shadowing the real homepage. - Add baseUrl + @/* paths to tsconfig.json so TypeScript resolves @/ imports. - Add 'use client' to admin/puzzle-submission/page.jsx (useState without directive). - Fix NFTRewardSection import path (NFTCard -> NftCard). - Replace undefined shareReferral onClick in invite-friends with placeholder. - Escape apostrophes in error.js, invite-friends/page.js, ref/[referralId]/page.js. - Disable ESLint during builds in next.config.mjs. Frontend tsc and next build now pass. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…igning security fixes Closes UnityChainxx#768 (CI workflow), UnityChainxx#782 (wallet signing audit), UnityChainxx#791 (missing TypeORM entities). - CI: replace the contracts-only workflow with a unified pipeline covering contracts (fmt/build/test, cargo cache), backend and frontend (lint, test, build) with an aggregate `all-checks` job for required status checks. Regenerate the root package-lock (ts-jest could not resolve jest-util in any clean install) and add a jest moduleNameMapper for `src/` imports plus a non-fixing `lint:ci` script. - TypeORM: register every entity in the codebase via a central registry (one canonical class per table, autoLoadEntities still appends forFeature registrations) so all feature repositories resolve metadata. Fix the source bugs that made repositories unresolvable regardless: services injecting repositories without @InjectRepository and with type-only entity imports (maintenance-mode, multiplayer-queue, user-settings), and normalize the last check-in date before streak comparison in daily-reward so yesterday's check-ins actually continue the streak. - Tests: repair 23 pre-existing broken suites (generated stubs with missing repository mocks, a spec containing a pasted copy of its service, mis-imported entities, shared mocks without clearing) so the full suite (48 suites / 166 tests) passes and CI can be green. - Security (issue UnityChainxx#782): document the wallet signing audit in docs/security/wallet-signing-audit.md; add a confirmation-gated, scope-checked signing helper (lib/stellar) with human-readable transaction summaries and a review dialog so no transaction is ever blind-signed; fix five garbled JSX strings that also failed lint. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…ution) Upstream main has absorbed independent implementations of the same issues this PR targets, so this merge aligns the branch with upstream's versions: - UnityChainxx#768: adopt upstream's expanded workflow suite (build.yml with workflow lint, path filtering, cargo-deny, coverage and backend/frontend jobs) and drop this branch's ci.yml as redundant. - UnityChainxx#791: adopt upstream's autoLoadEntities-only TypeORM setup plus its audit script, dropping this branch's hand-maintained entities registry. - UnityChainxx#782: keep upstream's wallet-auth implementation (wallet challenges, sessions, stellar-tx-verifier) and this branch's additive signing helper, review dialog and audit document. Everything else resolves in favour of upstream/main (canonical newer feature work: score validation, security headers, renamed game-mechanic module, TS-converted pages). Two latent upstream compile errors are fixed inline so the merged tree builds: missing helmet import in main.ts and a stale RateLimiterModule.forRoot() call in puzzle-solution-checker. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
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.
Closes #768
Closes #782
Closes #791
Targets
UnityChainxx/StellarHuntsissues (assigned to @Mirabel64):#768 — Unified CI pipeline
Replaces the contracts-only
build.ymlwith a singleci.ymlthat runs lint, test and build for all three workspaces:contractscargo fmt --check, wasm32 release build,cargo test(--locked)Swatinem/rust-cachebackend(matrix)eslint(new non-fixinglint:ci),jest,nest buildactions/setup-nodenpm cachefrontend(matrix)next lint,next buildactions/setup-nodenpm cacheall-checksThe
all-checkscheck is designed to be marked as a required status check (any workspace failure fails the pipeline;fail-fast: falseso one red workspace doesn't mask the others).Infrastructure fixes required to make CI actually green:
package-lock.json— the committed lockfile was internally inconsistent (hoistedts-jestwithoutjest-utilanywhere in the root graph); any cleannpm ciproduced a backend install that crashed jest on boot.moduleNameMapperforsrc/...imports that resolved under tsc's baseUrl but not jest, plus a non-mutatinglint:civariant of the backend lint script.#791 — Full TypeORM entity registration
backend/src/entities/entities.registry.tsenumerating every@Entityclass in the codebase (one canonical class per unique table; same-table duplicate copies kept as module-local dead imports, per the convention already documented inapp.module.ts), wired intoTypeOrmModule.forRootAsync—autoLoadEntitiescontinues to appendforFeatureregistrations from feature modules.MaintenanceModeService,MultiplayerQueueService,UserSettingsServiceinjectedRepository<T>without@InjectRepositoryand imported their entities type-only, so Nest had no dependency metadata at all → fixed.DailyRewardServicecompared the last check-in against midnight-normalized yesterday without normalizing the check-in itself, so consecutive-day streaks never continued → fixed.#782 — Wallet signing flow audit
docs/security/wallet-signing-audit.md: today there is no live signing path (frontend has zero Stellar imports; backend handler is mock-mode with a TODO sketch), so the enforceable deliverable is guardrails the first integration can't bypass:frontend/lib/stellar/txSummary.js— decodes every operation into structured, human-readable lines (fee, validity, memo, callfn(args)on contract) with contract/function allowlists from env; undecodable ops are marked unreadable.frontend/lib/stellar/signTransaction.js—signWithConfirmation()refuses to sign anything that isn't fully readable, in-scope (allow-listed StellarHunts contracts + functions), and explicitly confirmed by the user; a missing confirmation hook throws instead of silently signing.frontend/components/wallet/TransactionConfirmDialog.jsx— review dialog with an explicit "I have read the summary" checkbox before Confirm/Reject./connect-wallet(missing route linked from the Navbar) and the live custodian mint path.Spec repairs (23 broken suites)
The backend suite had never been runnable (see lockfile issue). Once it ran, 23 of 48 suites failed with pre-existing breakage unrelated to entity registration. All were repaired so CI could be green on this PR: generated stubs with missing repository mocks, a spec containing a pasted copy of its own service, mis-imported/mis-typed entities, expected-vs-actual drift, and mocks shared across tests without clearing. Final: 48/48 suites, 166/166 tests passing.
Also fixes five garbled JSX strings in
app/error.js,app/invite-friends/page.js,app/ref/[referralId]/page.js(botched merge artifacts that also failedreact/no-unescaped-entities).Verification
npm run build --workspace backend✅npm run test --workspace backend✅ 48 suites / 166 testsnpm run lint:ci --workspace backend✅ (no errors in any touched file)npm run lint --workspace frontend✅ (pre-existing<img>warnings only)npm run build --workspace frontend✅