Skip to content

Add Perbug Logic Locks puzzle, shared puzzle framework, and node integration - #381

Open
ercmine wants to merge 1 commit into
mainfrom
codex/implement-perbug-logic-locks-puzzle-type
Open

Add Perbug Logic Locks puzzle, shared puzzle framework, and node integration#381
ercmine wants to merge 1 commit into
mainfrom
codex/implement-perbug-logic-locks-puzzle-type

Conversation

@ercmine

@ercmine ercmine commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a third modular Perbug puzzle type (Logic Locks) that fits the existing node/puzzle flow and is deterministically generated from a node lat/lng seed.
  • Reuse and extend the shared puzzle abstractions so future deduction-style puzzles can plug into the same generator/validator/session model.
  • Surface puzzle difficulty and lifecycle hooks in the live node UI so puzzles participate in the game flow and analytics/reward plumbing.

Description

  • Added a small shared puzzle framework under app/lib/features/home/puzzles/puzzle_framework.dart introducing PuzzleSeedInput (deterministic seed from lat/lng + salts), PuzzleInstance, PuzzleSession, PuzzleDifficulty, generator/validator interfaces, seeded RNG helper, and analytics event types.
  • Implemented the Logic Locks puzzle in app/lib/features/home/puzzles/logic_locks_puzzle.dart including deterministic hidden-solution generation, modular clue generation (exact/not/ before/adjacent/either-or), solver-assisted uniqueness checks, ambiguity/contradiction/deduction depth estimates, difficulty scoring/tiering, player state (assign/reset/undo), and a validator for submission.
  • Integrated puzzle lifecycle and node hooks by extending PerbugGameState with active puzzle session and history and adding controller methods in app/lib/features/home/perbug_game_controller.dart for generate/start/clue-viewed/submit/succeed/fail/abandon plus a simple energy reward hook.
  • Exposed a playable UI flow in app/lib/features/home/perbug_game_page.dart with a generate CTA, pre-play difficulty display, a sheet listing clues, a slot assignment board, undo/reset/submit/abandon controls, and a small puzzle lifecycle telemetry preview.

Testing

  • Added unit tests at app/test/logic_locks_puzzle_test.dart covering deterministic same-seed generation, node-to-node differentiation, solvability/uniqueness when required, difficulty-scaling behavior, and validator correctness.
  • Attempted formatter/test runs in this environment but dart/flutter binaries are not installed so automated test execution and dart/flutter format were not possible here (toolchain missing).
  • Performed lightweight local sanity checks (file creation, git commit) and validated the repository compiles under a Flutter-capable environment is required to run the added tests and format code successfully.

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