Skip to content

Add Pattern Recall puzzle system with generator, validator, UI and controller integration - #383

Open
ercmine wants to merge 2 commits into
mainfrom
codex/implement-perbug-pattern-recall-puzzle-zu47eh
Open

Add Pattern Recall puzzle system with generator, validator, UI and controller integration#383
ercmine wants to merge 2 commits into
mainfrom
codex/implement-perbug-pattern-recall-puzzle-zu47eh

Conversation

@ercmine

@ercmine ercmine commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a deterministic, node-seeded puzzle system to enable location-tied gameplay for Perbug nodes.
  • Provide a repeatable generation pipeline and difficulty knobs so puzzles vary by node region and tuning parameters.
  • Integrate a preview-and-recall flow so users can preview sequences, input answers, and get success/failure handling.

Description

  • Add a lightweight puzzle framework in puzzles/perbug_puzzle_framework.dart with seeded RNG, PuzzleInstance/PuzzleGenerator/PuzzleValidator contracts and lifecycle helpers.
  • Implement PatternRecallGenerator in puzzles/pattern_recall/pattern_recall_generator.dart which deterministically generates symbol sequences, distractions, and difficulty knobs from a PuzzleSeedInput.
  • Add pattern recall models in puzzles/pattern_recall/pattern_recall_models.dart and a validator in puzzles/pattern_recall/pattern_recall_validator.dart that evaluates input vs expected with tolerance.
  • Add a bottom-sheet UI PatternRecallPuzzleSheet and wire a launch button into perbug_game_page.dart to open the puzzle sheet for the current node.
  • Extend the game state and controller (perbug_game_models.dart and perbug_game_controller.dart) with puzzle state, lifecycle events, controller methods (launchPatternRecallForCurrentNode, startPatternPreview, setPatternPreviewStep, completePatternPreview, inputPatternSymbol, clearPatternInput, retryPatternRecall, abandonPatternRecall, closePatternRecall), energy/reward hooks, and event logging.

Testing

  • Added app/test/perbug_pattern_recall_test.dart which exercises deterministic generation, difference across nodes, difficulty tuning, validator tolerance, and controller lifecycle/flow.
  • Ran the test suite with flutter test and the new tests passed (all assertions in perbug_pattern_recall_test.dart succeeded).

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