Skip to content
Merged
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
Puzzlink_Assistance.js
25 changes: 16 additions & 9 deletions docs/PROJECT_GUIDE_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,27 @@ src/
plugins/ # plugin contracts and registry
exporters/ # export adapters
difficulty/ # difficulty snapshot and rule usage aggregation
features/ # board, controls, replay, explanation, stats
features/ # solver controls, board rendering, editor tools, explanation, stats
test/ # test setup/runtime helpers
```

Design rule:

- UI should render and orchestrate.
- Domain should decide logic.
- The solver workspace and puzzle editor are separate product surfaces that exchange normalized `PuzzleIR`.

---

## 4. End-to-End Data Flow

1. Parser converts URL/input into IR (`PuzzleIR`).
2. Rule engine runs ordered rules and returns one step at a time.
3. Each step stores rule metadata + explicit diffs.
4. Timeline store replays diffs forward/backward.
5. Board and explanation panel render current state + reasoning history.
2. Optional editor tooling can create or modify initial puzzle IR before solving.
3. The solver store loads the initial IR and resets replay state.
4. Rule engine runs ordered rules and returns one step at a time.
5. Each step stores rule metadata + explicit diffs.
6. Timeline store replays diffs forward/backward.
7. Board and explanation panel render current state + reasoning history.

This guarantees the same inference chain can be replayed and inspected later.

Expand Down Expand Up @@ -137,7 +140,11 @@ If these two paths diverge, timeline replay and solver state will drift.

Implemented:

- Slitherlink puzz.link parse/encode baseline (URL input currently targets puzz.link; penpa-style URL support is planned)
- Dedicated solver workspace for import, solving, replay, explanation, stats, and export
- Dedicated editor workspace for puzzle construction before loading into the solver
- Slitherlink puzz.link parse/encode baseline
- Slitherlink Penpa import baseline
- Slitherlink editor tools for clues, pre-drawn line edges, crossed/blank edges, erasing, custom grid sizes, and built-in presets
- Ordered rule execution with step metadata
- Step replay (`Next`, `Previous`, `Solve to End`)
- Explanation-oriented deduction trace
Expand All @@ -146,9 +153,10 @@ Implemented:

Partially implemented / planned:

- Penpa adapter completeness
- More puzzle families (e.g. Masyu/Nonogram)
- Richer puzzle-specific interaction tools
- Puzzle-specific editor support for each puzzle family
- Canvas interaction and rendering optimization for larger boards and richer editor states
- Penpa adapter/export completeness
- Better calibrated difficulty modeling

Important expectation: difficult puzzles may stop at a stable but incomplete state if no rule applies.
Expand Down Expand Up @@ -181,4 +189,3 @@ When editing:
- `npm run test:run` - unit/component tests
- `npm run build` - production build
- `npm run test:e2e` - Playwright end-to-end tests

2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
trace: 'on-first-retry',
},
webServer: {
command: 'npm run dev -- --host 127.0.0.1 --port 4173',
command: `"${process.execPath}" ./node_modules/vite/bin/vite.js --host 127.0.0.1 --port 4173`,
port: 4173,
reuseExistingServer: true,
},
Expand Down
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Navigate, Route, Routes } from 'react-router-dom'
import { EditorPage } from './app/EditorPage'
import { WorkspacePage } from './app/WorkspacePage'

function App() {
return (
<Routes>
<Route path="/" element={<WorkspacePage />} />
<Route path="/editor" element={<EditorPage />} />
<Route path="*" element={<Navigate replace to="/" />} />
</Routes>
)
Expand Down
Loading
Loading