Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Full earlier progress and acceptance records are preserved in the [archive](docs

| Date | Change | Evidence | Result and limits |
| --- | --- | --- | --- |
| 2026-11-14 | Issue [#8](https://github.com/dadadave80/familiar/issues/8): swipe/tap and focused keyboard controls across the current Tide Run, retained courts and Bell/Reed crossings, on local branch `feat/direct-play-controls-current` | Source `782694c`, based on fetched `main` `91b5194` including merged #9; GitHub main rechecked at the same revision. `bun run test`: 491 pass/0 fail/40289 assertions; `cargo test --manifest-path contracts/Cargo.toml --workspace`: 182 pass/0 fail/3 ignored; typecheck/build, `make evidence` (15 canonical hashes/signatures and FINAL receipt graphs), `make break`, all eight gameplay/routing browser suites, records/season/Privy browser checks pass. Tide Run, passages and routing pass Chromium/WebKit; retained courts pass seven viewport journeys plus the complete normal-motion/recovery/save-failure tail; native touch suite passes 20 cases. Compiled QA passes 13 viewport profiles plus cold slow3G/gzip/touch/CPU4, with no failures and an offline local decision. [Logs and SHA256 inventory](/Users/dadadave/.codex/visualizations/2026/11/13/01a1d587-c1b9-7802-967f-8d1cf80455b9/issue-8-controls/logs/inventory.json) | Compact hints follow actual input; the native Button controls disclosure starts closed. Distinct 44px world actions, one-step swipes, free inspection and focused WASD/arrows preserve canonical action histories. Cancellation, multitouch, modal focus, resize/rotation, touch compatibility clicks and resumed hit targets are covered. No engine, save-format, contract, reward or account-authorization change. The full Bun suite needs loopback permission; a restricted repeat refused nine HTTP fixtures, then all 491 passed with it allowed. Mocked dev-harness warm-up emits Invalid hook call warnings; steady assertions and isolated guest/compiled console checks pass. Existing large-chunk build warning remains. No push, deployment or signing; physical-device comfort, pen and native Safari swipes remain unverified (WebKit covers taps/keyboard; Chromium covers native swipe sequences). |
| 2026-11-13 | Audited unused source and superseded reports retired locally | User authorized audited cleanup; independent cross-review of all65 changed/removed/replacement paths | Retired six-file dynamic NPC worker, unused IBM font/license, six redundant contract ignores, old guest/Google helper implementations and dead example settings. Live Google/Privy provider and native pending/recovery validators untouched; exact formatter/type and relevant security tests moved to current owners. Fresh setup omits retired worker settings while exact prior generated tuples validate unchanged. Eight superseded reports/585796 bytes plus old architecture/security descriptions and unused Mochi pose archived outside Git with exact-byte/SHA256 inventories. Archive index preserves historical references; current architecture/threat descriptions refreshed. No ledger/state migration, stored-key rewrite or source-history rewrite. |
| 2026-11-13 | Artwork delivery and cleaned build verified | Full233 Bun tests/15490 assertions,123 Rust passes, build/typecheck/fmt; offline15 signatures/58 receipt graphs | Six generator-only WebPs/1536100 bytes moved outside public delivery; all19 shipped WebPs unchanged; all11 optimized outputs reproduce exact bytes. Original pose1123042 bytes archived. Source and prepared Chromium/WebKit routes preserve intro-first, nine entry URLs and original saves;390px Beacon/Wind/lantern origin/save/art-failure journey and both Bell/Reed/discovery browser routes pass. Prepared574iax has367 static files,370 output files;10 actual local secret values absent and private H1 handler remains SHA256e3cc0335191ce63946bcdf9fe772fed2ee5db2678f7c193a12c86cfb64800e03. Relayer Docker COPY set passes isolated frozen offline production install and runtime bundling; actual Docker daemon unavailable. Existing Phaser size warning persists. User image and protected environment/journals/Wasm untouched. No push or deployment; physical-device sound/full two-device recovery/human enjoyment unverified. |
| 2026-11-13 | Documentation trimmed; Make shortcuts added | `make check`, `make typecheck`, `make browser`, `make evidence` | Full233 Bun tests/15490 assertions,123 Rust passes, typecheck/build and Chromium/WebKit route/save checks pass. Ten remaining historical JSONs/535460 bytes and full earlier JUDGES/PROGRESS snapshots archived byte-for-byte outside Git. Only gameplay proof and original-deployment guard JSONs remain. Make forwards to Bun/Cargo without deploy/signing recipes. Game, contract, recovery and original-operation implementations unchanged. No push/deployment or history rewrite; prior physical/human validation gaps remain. |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bun install --frozen-lockfile
make dev
```

No account is needed for the device preview. Use neighboring-platform taps, WASD/arrows or accessible buttons. Inspect is free. Sound is opt-in; reduced motion keeps the same outcomes. Device saves stay on that browser and never silently merge into a signed-in harbor.
No account is needed for the device preview. On touch screens, swipe once to move or tap a glowing neighboring platform. Tap **Wait** beside Mochi to wait and **Home** at the dock to finish the outing. On desktop, use WASD/arrows, Space to wait, R to finish at the dock and I for the free guide while the game has focus. Tide Run collects finds and banks cargo when Mochi steps onto them; the three-ask courts also use E for nearby objects. Mouse targeting still works; optional **Button controls** expose the same actions. Sound is opt-in; reduced motion keeps the same outcomes. Device saves stay on that browser and never silently merge into a signed-in harbor.

## Commands

Expand Down
46 changes: 46 additions & 0 deletions scripts/browser-controls.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import assert from "node:assert/strict";
import type { Page } from "@playwright/test";

/** Drive the public play surface, leaving command validation and saving to the game. */
export async function guide(page:Page,command:string){
const game=page.locator('[data-testid="expedition-game"],[data-testid="passage-game"],[data-testid="tide-run"]').last();
const key:Record<string,string>={"step:north":"ArrowUp","step:south":"ArrowDown","step:west":"ArrowLeft","step:east":"ArrowRight",north:"ArrowUp",south:"ArrowDown",west:"ArrowLeft",east:"ArrowRight",wait:"Space",return:"r",home:"r"};
if(key[command]){await game.focus();await page.keyboard.press(key[command]);return;}
if(command.startsWith("lure:")){
await worldAction(page,"lantern");
const lane=command.slice(5);await page.getByRole("button",{name:`Lure ${lane[0]!.toUpperCase()+lane.slice(1)}`,exact:true}).click();return;
}
if(command.startsWith("take:")||command.startsWith("reel:")){
const item=command.split(":")[1],x=item==="lens"?0:item==="moth"?2:1;
const tiles=JSON.parse((await page.getByTestId("expedition-world").getAttribute("data-tiles"))!) as {position:{x:number;y:number};x:number;y:number}[];
const tile=tiles.find(tile=>tile.position.x===x&&tile.position.y===4);assert(tile,`world target for ${command}`);
await page.mouse.click(tile.x,tile.y);return;
}
await worldAction(page,command);
}

export async function worldAction(page:Page,action:string,touch=false){
await page.evaluate(()=>new Promise<void>(resolve=>requestAnimationFrame(()=>requestAnimationFrame(()=>resolve()))));
const world=page.locator('[data-testid="expedition-world"],[data-testid="tide-world"]').last();
const actions=JSON.parse((await world.getAttribute("data-actions"))??"[]") as {action:string;x:number;y:number}[];
const target=actions.find(target=>target.action===action);assert(target,`visible world action ${action}; position=${await world.getAttribute("data-position")}; turn=${await world.getAttribute("data-turn")??await world.getAttribute("data-beat")}; available=${JSON.stringify(actions)}`);
const hit=await page.evaluate(({x,y})=>{const node=document.elementFromPoint(x,y);return{tag:node?.tagName,owner:node?.closest(".exp-command-tray,.exp-feedback,.exp-hud")?.className,html:node?.outerHTML.slice(0,180),viewport:[innerWidth,innerHeight],canvas:document.querySelector("canvas")?.getBoundingClientRect().toJSON()};},target);
assert.equal(hit.tag,"CANVAS",`world action ${action} is covered at ${target.x},${target.y}: ${JSON.stringify(hit)}`);
if(touch)await page.touchscreen.tap(target.x,target.y);else await page.mouse.click(target.x,target.y);
}

export async function buttonControls(page:Page,open=true){
const controls=page.locator("details.exp-button-controls");
if(await controls.evaluate(node=>(node as HTMLDetailsElement).open)!==open)await controls.locator("summary").click();
}

/** Original courts remain available from the Harbor chart beside the current story/daily tide. */
export async function departCourt(page:Page){
const preparation=page.locator('.exp-panel[data-surface="sail"] .exp-primary');
if(await preparation.isVisible()){await preparation.click();return;}
const depart=page.locator('[data-action="depart"]');
if(await depart.isVisible()){await depart.click();return;}
await page.getByRole("button",{name:"Harbor chart",exact:true}).and(page.locator(":visible")).click();
await page.locator('.exp-panel[data-surface="chart"] .harbor-routes > li').first().getByRole("button").click();
await page.locator('.exp-panel[data-surface="sail"] .exp-primary').click();
}
Loading