Skip to content

Add deterministic Perbug Word Weave puzzle (modular puzzle #5) - #386

Open
ercmine wants to merge 1 commit into
mainfrom
codex/implement-perbug-word-weave-puzzle
Open

Add deterministic Perbug Word Weave puzzle (modular puzzle #5)#386
ercmine wants to merge 1 commit into
mainfrom
codex/implement-perbug-word-weave-puzzle

Conversation

@ercmine

@ercmine ercmine commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a fifth modular puzzle type (Word Weave) that plugs into the existing node/puzzle architecture and is deterministically generated from node lat/lng.
  • Reuse and extend a small shared puzzle framework so future word/language variants can be added without duplicating core session/generator/validator logic.
  • Surface pre-play difficulty and lifecycle hooks so puzzles integrate with node visits, rewards, retries, and analytics flows.

Description

  • Introduced a compact shared puzzle framework with stable seed derivation from nodeId|lat|lng|salt (SHA-256 -> 32-bit seed), common types (PuzzleType, PuzzleSeedInput, PuzzleDifficulty, PuzzleInstance, PuzzleSession, PuzzleResult), lifecycle events, and generator/validator interfaces (app/lib/features/home/perbug_puzzles/puzzle_framework.dart).
  • Implemented Word Weave as puzzle type Add typed env/remote provider configuration and integrate with ProviderRouter #5 with: deterministic target-word selection and letter-pool/branch-preview generation from the node seed; configurable difficulty knobs (letterPoolSize, targetWordLength, decoyDensity, branchingOptions, retryAllowance, dictionaryStrictness); difficulty scoring/tier/explainer; decoy injection and fairness checks; dictionary adapter with strictness modes; validator that enforces letter-pool assembly and dictionary/target rules (app/lib/features/home/perbug_puzzles/word_weave.dart).
  • Extended game state and controller to persist and manage an active puzzle session, add lifecycle flows (generate → start → submission_attempted → succeeded/failed/abandoned), and provide input/undo/clear/submit/abandon operations; included deterministic session creation from the current node seed and default difficulty config (app/lib/features/home/perbug_game_models.dart, app/lib/features/home/perbug_game_controller.dart).
  • Added a native-feeling UI panel on the Perbug world page to launch Word Weave for the current node, show human-readable difficulty and retry/strictness info, display the letter pool and branch preview, and support tap-to-build, undo, clear, submit, and abandon actions plus completion/failure summaries (app/lib/features/home/perbug_game_page.dart).
  • Added unit tests to cover determinism, node-seed differentiation, difficulty scaling, solvability (target always assemble-able from pool), decoy density behavior, dictionary-strictness effects, and retry exhaustion (app/test/perbug_word_weave_test.dart).

Testing

  • Ran repository checks with git diff --check which reported no whitespace/diff issues.
  • Added focused unit tests in app/test/perbug_word_weave_test.dart; execution was attempted via cd app && flutter test test/perbug_word_weave_test.dart but test execution failed in this environment because flutter is not installed (automated tests could not be run here).
  • Attempted to run dart format on modified files but the environment lacked the Dart/Flutter toolchain so formatting and full test runs were not executed; the new tests are included and are written to be run in CI or a developer environment with Flutter/Dart installed.

Codex Task

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant