Repository navigation
fix: resolve all issues assigned to solomon35-stack (#538, #529, #511, #468) - #646
Merged
dzekojohn4 merged 2 commits intoSep 29, 2026
Conversation
…assigned to solomon35-stack - UnityChainxx#468: operation-labeled invariant tests for interleaved admin mutations (add/move/retire/set_question_per_level) including get_question_in_level enumeration and a drained-level case; fixes the broken lib.rs build by appending the missing Error variants QuestionRetired=15 and WrongQuestion=16 and aligning test discriminants (UnityChainxx#14 was SchemaVersionMismatch). - UnityChainxx#511: admin puzzle-submission form now persists through the backend draft API (create/update/publish), reports per-field validation errors, preserves content on failure; adds puzzleDraftService and vitest coverage. - UnityChainxx#538: already satisfied on main by the extracted config schema; the fail-closed STELLAR_MODE=live default is documented and asserted by config-validation.spec.ts. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
, UnityChainxx#468 assigned to solomon35-stack UnityChainxx#468 — contract-level invariant tests for interleaved admin mutations: assert_index_invariant harness, interleaved-operation test, level-drain test; also adds the missing Error::QuestionRetired / Error::WrongQuestion variants so the crate compiles and `cargo test --workspace --locked` runs. UnityChainxx#511 — wire the admin puzzle submission form to the backend draft API (create/update/publish), per-field validation errors, no content loss on failed saves, plus vitest coverage. UnityChainxx#529 — every request DTO now carries class-validator decorators so the global ValidationPipe (whitelist + forbidNonWhitelisted, aligned between main.ts and its spec) validates instead of silently stripping bodies; response-only DTOs are marked; representative rejection tests added; the DTO convention is documented in CONTRIBUTING.md. Green-CI prerequisites found broken on main and repaired here: - CI built wasm with rust >= 1.82 on wasm32-unknown-unknown, which soroban-sdk 28 aborts; switch build/release to wasm32v1-none. - root package-lock.json was out of sync with frontend deps (npm ci failed); regenerated. - backend mixed NestJS 11 core with 12 platform packages; aligned to 11.x and dropped the unused @nestjs/serve-static (no 11.x exists). - fixed half-merged files that broke compilation (stellar-handler, multiplayer gateway/service, streak service, several controllers) and restored the buildOpenApiDocument export so docs/openapi.json + docs/api.md regenerate. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@solomon35-stack Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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 #538
Closes #529
Closes #511
Closes #468
Together these close every issue currently assigned to @solomon35-stack on this repository. This PR supersedes #645 (same three issues, but its CI was red); here the green-CI blockers on main are fixed as part of the change so the whole suite can pass.
Issue #468 — contract-level invariant tests for interleaved admin mutations
In
onchain/contracts/stellar_hunts/src/test.rs:assert_index_invariant— asserts the index invariant documented inlib.rs:QuestionPerLevelIndex(level)equals the number of live entries, each live id appears exactly once across the indices, no id appears in a foreign level, and the first slot past the live window is cleared.test_index_invariant_holds_after_each_interleaved_admin_operation— deterministicadd_question/update_questionlevel-moves /retire_question/set_question_per_levelsequence with the invariant checked after every operation, plus enumeration viaget_question_in_level.test_index_invariant_when_a_level_is_drained_by_retirements— drains a level one retirement at a time; a failed retirement leaves the indices untouched and the count at 0.Build prerequisite fixed: upstream
maindid not compile —lib.rsreferencedError::QuestionRetired/Error::WrongQuestionwhich did not exist. Appended as variants 15/16 (discriminants stay stable) and aligned four test assertions written against wrong discriminants.Verified locally:
cargo test --workspace --locked→ 41 passed (stellar-hunts incl. 2 new tests), 13 passed (nft), 0 failed.Issue #511 — persist puzzle draft and submission forms to the backend
frontend/services/puzzleDraftService.js:createDraft(POST/drafts),updateDraft(PATCH/drafts/:id),publishDraft(POST/drafts/:id/publish), plusextractFieldErrors(maps class-validator message arrays onto per-field errors) andbuildDraftPayload(maps the form ontoCreateDraftDto, parsing NFT-metadata JSON client-side so malformed blobs never reach the wire).frontend/app/admin/puzzle-submission/page.jsxno longer posts to a non-existent/admin/puzzles: save-as-draft with update-mode switch (draftId), Publish via the backend endpoint distinguishing "saved" vs "published", per-field errors, and no clearing of entered content on failed saves (reset only after successful publish). Authorization stays server-side (JwtAuthGuard + RolesGuard, admin-only).frontend/tests/admin-puzzle-submission.test.jsxcovers draft save/update, publish success/failure, field-error mapping, and no-data-loss on failure.Issue #529 — request DTOs declare no class-validator decorators
POST /badges/assign(AssignBadgeDto) is now fully validated (@IsInt @IsPositive); previouslywhitelist: truestripped the entire body and the handler received{}.CreateReportCardBodyDtoso the pipe can no longer strip it into an untyped{}.UpdateDraftDtogains a validated optionalstatus(@IsIndraft workflow states) so the transition matrix in the service typechecks and is enforced by the pipe.forbidNonWhitelisteddecision is settled once:main.tsnow enables it, matchingglobal-validation-pipe.spec.ts. The report controller keeps its explicit stricter local pipe as documented.// Response-only DTO (issue #529)header comment and carry no decorators by design.backend/src/config/dto-whitelist.spec.tsasserts: empty body rejected for a required request DTO, wrongly-typed field rejected, empty body accepted for an all-optional request DTO while unknown fields are rejected.CONTRIBUTING.mddocuments the convention: request DTOs must decorate required fields; response-only DTOs are marked;update-*extends the decoratedcreate-*viaPartialType.docs/openapi.json/docs/api.mdregenerate cleanly (buildOpenApiDocumentexport restored insrc/swagger.ts; the script previously could not compile at all).Green-CI prerequisites (broken on
mainitself, fixed here)The PR's CI cannot pass without these, so they are included:
wasm32-unknown-unknown.build.ymlandrelease.ymlnow build forwasm32v1-none(Rust 1.84+, the target soroban-sdk 28 requires). Paths and artifact checks updated.npm ci— the rootpackage-lock.jsonwas stale againstfrontend/package.json(tailwindcss 3.4.19 vs ^4.3.3, eslint-config-prettier 9 vs 10), failing every frontend job. Regenerated; rootnpm civerified clean.@nestjs/common11.x with@nestjs/platform-express/socket.io12.x (peer-incompatible;./internalexport missing → runtime ERR_MODULE_NOT_FOUND in the OpenAPI job). Aligned platform packages to 11.x; removed the unused@nestjs/serve-static(no 11.x exists, peers require core 12).stellar-handler.service.ts(restored the intact real-Soroban implementation from 447f394, keeping the stricter mergedvalidateRpcUrl),multiplayer-queuegateway/service (notifyMatchCreatedrestored), streak service/type imports, duplicate imports/identifiers in several controllers, duplicatedproviderskey inpuzzle-submission.module.ts.Verification
cd onchain && cargo test --workspace --locked— 54 passed, 0 failedcd backend && npx jest src/config— validation suites pass (7 tests)tsc --noEmit: no new errors vs. the branch base (127 pre-existing on main, all tracked upstream issues, none introduced here)npm ci— cleanNote: the
lintstep offrontend/package.jsonon this branch still lacks the upstreamcheck:configwrapper; this branch carries no frontend lint regressions from its own diff.